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

Summary: Auto-generated code for Exception handling is too verbose
Product: java Reporter: fommil <fommil>
Component: HintsAssignee: Max Sauer <msauer>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: mmirilovic
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

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 ***