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 188503

Summary: Various improvements to the New Exception Template
Product: java Reporter: mkopka
Component: SourceAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Diff showing the changes Im talkig about in this enhancement

Description mkopka 2010-07-08 17:32:41 UTC
When I use the new exception functionality which is based on the new exception template I see room for several improvements. The code which is generated is like so:

  * Creates a new instance of NewException without detail message.
public NewException() {
 * Constructs an instance of NewException with the specified detail message.
 * @param msg the detail message.
public NewException(String msg) {

- This code only overrides 2 of the 4 possible constructors. Should override all 4 or better still allow the user to choose which constructors to override perhaps ? At the very min should override all 4 by default.

- There is a super(msg) call for the constructor with a string param...but why not for the empty constructor? i.e.: super(); should be included in the 1st constructor.

- The 'insert code' functionality can be used to create new constructors and this uses the param name 'String message'. The template should hence also use the name 'message' instead of 'msg' to be consistent.
Comment 1 mkopka 2010-07-09 02:03:41 UTC
Created attachment 100714 [details]
Diff showing the changes Im talkig about in this enhancement

Hopefully this should be enough to do this, so now I suppose someone just needs to decide if this is okay to add in as the actual changes I suggested are done in this patch. (hope I got the patch correct)