src/share/classes/java/lang/Package.java

Print this page
rev 3509 : 7021209: convert lang, math, util to use try-with-resources
Reviewed-by: XXX

*** 574,589 **** /* * 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; } catch (IOException e) { return null; } } --- 574,587 ---- /* * 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)) ! { ! return jis.getManifest(); } catch (IOException e) { return null; } }