6714834: JarFile.getManifest() leaves an open InputStream as an undocumented side effect
Reviewed-by: lancea, alanb
This commit is contained in:
parent
e5866aa756
commit
671dfba802
@ -423,7 +423,9 @@ public class JarFile extends ZipFile {
|
||||
}
|
||||
man = new Manifest(jv, new ByteArrayInputStream(b), getName());
|
||||
} else {
|
||||
man = new Manifest(super.getInputStream(manEntry), getName());
|
||||
try (InputStream is = super.getInputStream(manEntry)) {
|
||||
man = new Manifest(is, getName());
|
||||
}
|
||||
}
|
||||
manRef = new SoftReference<>(man);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user