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.
Summary: | Simplifying exception catch block | ||
---|---|---|---|
Product: | java | Reporter: | arungupta <arungupta> |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.0.1 | ||
Hardware: | PC | ||
OS: | Other | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
arungupta
2011-09-07 05:24:40 UTC
I support this bug track. I had the same situation today. The following code throws two kinds of exception, MalformedURLException and IOException URL url = new URL(input); URLConnection uRLConnection = url.openConnection(); uRLConnection.connect(); netbeans shows two hints: surround statement with try-catch surround block with try-catch but no "surround with multi try-catch" it would be nice to get something like: try { URL url = new URL(input); URLConnection uRLConnection = url.openConnection(); uRLConnection.connect(); } catch (MalformedURLException ex) { Logger.getLogger(Service.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(Service.class.getName()).log(Level.SEVERE, null, ex); } after a single quick fix. |