This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 192145 - RFE: Generate... -> null params checking
Summary: RFE: Generate... -> null params checking
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2010-11-18 23:29 UTC by pekarna
Modified: 2010-11-19 08:51 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description pekarna 2010-11-18 23:29:37 UTC
My suggestion:

On Alt + Insert, when in a method with params, add option "null params check" to generate code like

public myMethod( Object par1, Object par2 ){
  // ---- Generated code:
  if( par1 == null ) throw new IllegalArgumentException("par1 must not be null.");
  if( par2 == null ) throw new IllegalArgumentException("par2 must not be null.");
  // ----

Thanks for considering.