mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2024-12-30 21:07:42 +01:00
try with resources cuz haters
This commit is contained in:
parent
49eceaae50
commit
dd5ec37055
@ -67,9 +67,7 @@ public class FileUtil {
|
|||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList<>();
|
list = new ArrayList<>();
|
||||||
}
|
}
|
||||||
try {
|
try (URLClassLoader cl = new URLClassLoader(new URL[]{jar}, clazz.getClassLoader()); JarInputStream jis = new JarInputStream(jar.openStream())) {
|
||||||
URLClassLoader cl = new URLClassLoader(new URL[]{jar}, clazz.getClassLoader());
|
|
||||||
JarInputStream jis = new JarInputStream(jar.openStream());
|
|
||||||
while (true) {
|
while (true) {
|
||||||
JarEntry j = jis.getNextJarEntry();
|
JarEntry j = jis.getNextJarEntry();
|
||||||
if (j == null) {
|
if (j == null) {
|
||||||
@ -88,8 +86,6 @@ public class FileUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cl.close();
|
|
||||||
jis.close();
|
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
Loading…
Reference in New Issue
Block a user