views:

48

answers:

2

Is there a shortcut for inserting the code:

if (someParameter == null)
   throw NullPointerException("someParameter is null");
+2  A: 

There isn't a template defined for that but you can easily create one. Just follow the steps described here.

Hugo Palma
A: 

If you are okay with having some annotations in your code then you could try the solution mentioned here. It does not solve the problem directly but if you have this kind of null checks at many places you can use this :)

Calm Storm