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 139589 - Auto-generated code for Exception handling is too verbose
Summary: Auto-generated code for Exception handling is too verbose
Status: RESOLVED DUPLICATE of bug 133145
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Max Sauer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-10 13:59 UTC by fommil
Modified: 2008-10-15 09:38 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fommil 2008-07-10 13:59:25 UTC
If I have a statement that can throw a checked exception, the hinter will suggest that the statement be surrounded in a try-catch. The catch block will 
typically have the following verbose code in it:-

Logger.getLogger(MyClass.class.getName()).log(Level.SEVERE, null, ex);

However, I typically have a private static final Logger assigned to each of my classes with the field name 'log'. I would therefore rather that the 
autogenerated code read (much more tersely) as

log.severe(ex);

However, there does not appear to be a way to do this at the moment. I request that this be supported.
Comment 1 Jan Becicka 2008-07-24 15:00:46 UTC
Good enhancement
Comment 2 Max Sauer 2008-10-15 09:38:24 UTC
This should be solved via Surround with t-c user options.

*** This issue has been marked as a duplicate of 133145 ***