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.
try (final BufferedReader br = new BufferedReader(new FileReader("misc.txt"), 1_000_000)) { ... stuff... } Choosing to add an exception (IOException in my case) breaks the code. I believe the refactoring is not "try-with-resources aware" yet. Product Version = NetBeans IDE Dev (Build 201201050601) Operating System = Mac OS X version 10.7.2 running on x86_64 Java; VM; Vendor = 1.6.0_29 Runtime = Java HotSpot(TM) 64-Bit Server VM 20.4-b02-402
Fixed by added a new "Add catch Clause(s)" fix - the "Surround Block" will no longer be proposed to this code: http://hg.netbeans.org/jet-main/rev/edbcc4f9da7d Fixing formatting after adding the very first catch clause: http://hg.netbeans.org/jet-main/rev/89f350f83c64
Integrated into 'main-golden', will be available in build *201212140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/edbcc4f9da7d User: Jan Lahoda <jlahoda@netbeans.org> Log: #207480: better handling of surround with try-catch: rather than showing Surround with block and then adding a catch into a surrounding try-catch, show directly 'Add catch Clause'
*** Bug 137713 has been marked as a duplicate of this bug. ***
*** Bug 75741 has been marked as a duplicate of this bug. ***