Findbugs and Jackpot have identified a number of places in the jar and zip implementation classes and tests where try-with-resources can be used. This will fix bugs in certain cases, for example, in src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java there is the following code (near line 240):
FileInputStream fis = new FileInputStream(inFile);
run(fis, jstream, mappedFile);
fis.close();
If the run() call were to throw an exception, the FileInputStream would be left open. Using try-with-resources the code would be changed to:
try (FileInputStream fis = new FileInputStream(inFile)) {
run(fis, jstream, mappedFile);
}
There are a few dozen similar changes in several places in the library and in the corresponding test code.