Skip to content

Commit

Permalink
OPENJPA-2674 properly closing JarFile
Browse files Browse the repository at this point in the history
txs to Kaloyan Spiridonov for the catch!


git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1768201 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
struberg committed Nov 5, 2016
1 parent 701a4e7 commit 4068d5c
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -369,10 +369,8 @@ private static Class<?> loadVMClass(File toolsJar, Log log, JavaVendors vendor)
* @return True if the provided agentClassName is defined as the Agent-Class
* in the manifest from the provided agentJarFile. False otherwise.
*/
private static boolean validateAgentJarManifest(File agentJarFile, Log log,
String agentClassName) {
try {
JarFile jar = new JarFile(agentJarFile);
private static boolean validateAgentJarManifest(File agentJarFile, Log log, String agentClassName) {
try (JarFile jar = new JarFile(agentJarFile)) {
Manifest manifest = jar.getManifest();
if (manifest == null) {
return false;
Expand Down

0 comments on commit 4068d5c

Please sign in to comment.