From 07c0a8bced01343f4580fdc0de88a6c4fc418527 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 17 Aug 2022 13:22:17 -0700 Subject: [PATCH] Fix SecurityManager deprecation issues See gh-32086 --- .../java/org/springframework/boot/loader/jar/JarFile.java | 4 +--- .../org/springframework/boot/loader/jar/JarFileWrapper.java | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java index 9c19e943d2..9ca27bc518 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java @@ -128,9 +128,7 @@ public class JarFile extends AbstractJarFile implements Iterable manifestSupplier) throws IOException { super(rootFile.getFile()); - if (System.getSecurityManager() == null) { - super.close(); - } + super.close(); this.rootFile = rootFile; this.pathFromRoot = pathFromRoot; CentralDirectoryParser parser = new CentralDirectoryParser(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileWrapper.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileWrapper.java index ad98ca801a..2c9665e430 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileWrapper.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileWrapper.java @@ -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