Use try-with-resources instead of manual try/finally
This commit is contained in:
@@ -132,8 +132,7 @@ public class CompileEnvironmentUtil {
|
||||
}
|
||||
|
||||
private static void copyJarImpl(JarOutputStream stream, File jarPath) throws IOException {
|
||||
JarInputStream jis = new JarInputStream(new FileInputStream(jarPath));
|
||||
try {
|
||||
try (JarInputStream jis = new JarInputStream(new FileInputStream(jarPath))) {
|
||||
while (true) {
|
||||
JarEntry e = jis.getNextJarEntry();
|
||||
if (e == null) {
|
||||
@@ -145,9 +144,6 @@ public class CompileEnvironmentUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
jis.close();
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user