mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-22 18:55:17 +01:00
Used try-with-resources to ensure jar is closed.
This commit is contained in:
parent
28b88763e6
commit
56ff9f62e4
@ -101,7 +101,7 @@ public final class AddonsManager {
|
||||
if (!f.getName().endsWith(".jar")) {
|
||||
return;
|
||||
}
|
||||
JarFile jar = new JarFile(f);
|
||||
try (JarFile jar = new JarFile(f)) {
|
||||
|
||||
// Obtain the addon.yml file
|
||||
JarEntry entry = jar.getJarEntry("addon.yml");
|
||||
@ -145,9 +145,8 @@ public final class AddonsManager {
|
||||
|
||||
// Inform the console
|
||||
plugin.getLogger().info("Loading BSkyBlock addon " + addon.getDescription().getName() + "...");
|
||||
}
|
||||
|
||||
// Close the jar
|
||||
jar.close();
|
||||
} catch (Exception e) {
|
||||
if (DEBUG) {
|
||||
plugin.getLogger().info(f.getName() + "is not a jarfile, ignoring...");
|
||||
|
Loading…
Reference in New Issue
Block a user