You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Kaloyan Spiridonov (JIRA)" <ji...@apache.org> on 2016/10/18 11:48:58 UTC

[jira] [Created] (OPENJPA-2674) JarFile is not closed

Kaloyan Spiridonov created OPENJPA-2674:
-------------------------------------------

             Summary: JarFile is not closed
                 Key: OPENJPA-2674
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2674
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 2.4.1
            Reporter: Kaloyan Spiridonov


In InstrumentationFactory class at line 375 JarFile is not closed.
{code}
 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;
            }
            Attributes attributes = manifest.getMainAttributes();
            String ac = attributes.getValue("Agent-Class");
            if (ac != null && ac.equals(agentClassName)) {
                return true;
            }
        } catch (Exception e) {
            if (log.isTraceEnabled() == true) {
                log.trace(_name
                    + ".validateAgentJarManifest() caught unexpected "
                    + "exception " + e.getMessage());
            }
        }
        return false;
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)