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.
Product Version: NetBeans IDE Dev (Build 080730) Java: 1.5.0_14; Java HotSpot(TM) Client VM 1.5.0_14-b03 System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb) Userdir: F:\hg\main\nbbuild\testuserdir 1, I have code like FileInputStream fis = new FileInputStream(filename); int x = fis.available(); byte b[] = new byte[x]; fis.read(b); String content = new String(b); System.out.println(content); 2, use hint "Surround \block with try-catch" on the first line -> result looks strange, why there is the "try { fis = null" ? FileInputStream fis = null; try { fis = null; try { fis = new FileInputStream(filename); int x = fis.available(); byte[] b b = new byte[x]; fis.read(b); String content = new String(b); System.out.println(content); } catch (FileNotFoundException ex) { Exceptions.printStackTrace(ex); } finally { try { fis.close(); } catch (IOException ex) { Exceptions.printStackTrace(ex); } } String content = new String(b); System.out.println(content); } catch (FileNotFoundException ex) { Exceptions.printStackTrace(ex); } finally { try { fis.close(); } catch (IOException ex) { Exceptions.printStackTrace(ex); } }
Dup of issue 142199 ?
Yes, it's dup of issue 142199. I cannot reproduce now when 142199 is fixed *** This issue has been marked as a duplicate of 142199 ***