提交 5322e870 编写于 作者: U Ufuk Celebi

[FLINK-2538] Close created JarFile in ClassLoaderUtil

上级 b2f8e307
...@@ -72,13 +72,19 @@ public class ClassLoaderUtil { ...@@ -72,13 +72,19 @@ public class ClassLoaderUtil {
bld.append(" (directory)"); bld.append(" (directory)");
} }
else { else {
JarFile jar = null;
try { try {
new JarFile(filePath); jar = new JarFile(filePath);
bld.append(" (valid JAR)"); bld.append(" (valid JAR)");
} }
catch (Exception e) { catch (Exception e) {
bld.append(" (invalid JAR: ").append(e.getMessage()).append(')'); bld.append(" (invalid JAR: ").append(e.getMessage()).append(')');
} }
finally {
if (jar != null) {
jar.close();
}
}
} }
} }
else { else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册