Fix SecurityManager deprecation issues

See gh-32086
This commit is contained in:
Phillip Webb 2022-08-17 13:22:17 -07:00
parent 4ec2e357d9
commit 07c0a8bced
2 changed files with 2 additions and 6 deletions

View File

@ -128,9 +128,7 @@ public class JarFile extends AbstractJarFile implements Iterable<java.util.jar.J
private JarFile(RandomAccessDataFile rootFile, String pathFromRoot, RandomAccessData data, JarEntryFilter filter,
JarFileType type, Supplier<Manifest> manifestSupplier) throws IOException {
super(rootFile.getFile());
if (System.getSecurityManager() == null) {
super.close();
}
super.close();
this.rootFile = rootFile;
this.pathFromRoot = pathFromRoot;
CentralDirectoryParser parser = new CentralDirectoryParser();

View File

@ -40,9 +40,7 @@ class JarFileWrapper extends AbstractJarFile {
JarFileWrapper(JarFile parent) throws IOException {
super(parent.getRootJarFile().getFile());
this.parent = parent;
if (System.getSecurityManager() == null) {
super.close();
}
super.close();
}
@Override