Is there a way to code complete a null check in java within netbeans IDE? -


in netbeans can stuff writing "psvm" pressing tab , generates

 public static void main(string[] args) {      //your cursor placed here.  } 

similarly there way write cycles, try catch blocks, instanceof checks , stuff that. there resembling approach, generate null-check of variable?

i this:

resultset rs; rs //pressing magic button ctrl+space or "rs null<tab>"     //and code generated:  if (rs != null) //your cursor placed here. 

or

if (rs != null) {     //your cursor here } 

you can create own template that:

go tools->options->editor->code templates->new->abbreviation: ifnn

expanded text:

if (${exp instanceof=”object”} != null) {     ${selection}${cursor} } 

then press "ifnn"+tab in editor.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -