jdk/src/share/classes/java/lang/Package.java
changeset 8543 e5ec12a932da
parent 7803 56bc97d69d93
child 9035 1255eb81cc2f
child 9266 121fb370f179
--- 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;
         }