--- a/jdk/src/share/classes/java/lang/Package.java Tue Feb 22 12:01:35 2011 -0800
+++ b/jdk/src/share/classes/java/lang/Package.java Tue Feb 22 15:34:17 2011 -0800
@@ -576,12 +576,10 @@
* Returns the Manifest for the specified JAR file name.
*/
private static Manifest loadManifest(String fn) {
- try {
- FileInputStream fis = new FileInputStream(fn);
- JarInputStream jis = new JarInputStream(fis, false);
- Manifest man = jis.getManifest();
- jis.close();
- return man;
+ try (FileInputStream fis = new FileInputStream(fn);
+ JarInputStream jis = new JarInputStream(fis, false))
+ {
+ return jis.getManifest();
} catch (IOException e) {
return null;
}