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 - Various improvements to the New Exception Template
Summary: Various improvements to the New Exception Template
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-08 17:32 UTC by mkopka
Modified: 2013-09-02 14:21 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Diff showing the changes Im talkig about in this enhancement (1.66 KB, patch)
2010-07-09 02:03 UTC, mkopka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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) {
   super(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)