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.
I created the following snippet of code to demonstrate this: public static void main(final String[] args) throws IOException { final char[] buffer = new char[100]; final FileReader reader = new FileReader("test.txt"); final FileWriter writer = new FileWriter("test2.txt"); reader.read(buffer); writer.write(buffer); writer.close(); reader.close(); } Using the available "Convert to try-with-resources" gives me the following: public static void main(final String[] args) throws IOException { final char[] buffer = new char[100]; try (FileReader reader = new FileReader("test.txt")) { final FileWriter writer = new FileWriter("test2.txt"); reader.read(buffer); writer.write(buffer); writer.close(); } } However, since the Java 7 try-with-resources statement allows more than one resource, it should be able to give me this: public static void main(final String[] args) throws IOException { final char[] buffer = new char[100]; try (FileReader reader = new FileReader("test.txt"); FileWriter writer = new FileWriter("test2.txt");) { reader.read(buffer); writer.write(buffer); } }
Update: shortly after writing up this bug, I noticed that it gave me the hint again on the FileWriter, and using that added it to the list of resources for the try block, but it should have been able to use both with one such hint.
Feel free to reassign back.
As described in comment #1 it's possible to do it by another invocation of the hint. Yes, it can be done that all these hints are invoked at once (requires either a new item in the hint or option).
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss