Close plugin jar file on classloader close and after retrieving name for updating (#8902)

This commit is contained in:
Emily
2023-02-28 08:34:33 -03:00
parent 5a125e0fc3
commit 2ad6c390e0
4 changed files with 17 additions and 16 deletions

View File

@@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.description = description;
this.dataFolder = dataFolder;
this.file = file;
- this.jar = new JarFile(file);
+ this.jar = new JarFile(file, true, java.util.zip.ZipFile.OPEN_READ, JarFile.runtimeVersion()); // Paper - enable multi-release jars for Java 9+
- this.jar = jarFile == null ? new JarFile(file) : jarFile; // Paper - use JarFile provided by SpigotPluginProvider
+ this.jar = jarFile == null ? new JarFile(file, true, java.util.zip.ZipFile.OPEN_READ, JarFile.runtimeVersion()) : jarFile; // Paper - use JarFile provided by SpigotPluginProvider // Paper - enable multi-release jars for Java 9+
this.manifest = jar.getManifest();
this.url = file.toURI().toURL();
this.libraryLoader = libraryLoader;