Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2674

JarFile is not closed

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.1
    • 2.4.2, 3.0.0
    • None
    • None

    Description

      In InstrumentationFactory class at line 375 JarFile is not closed.

       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;
          }
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            struberg Mark Struberg
            kal0ian Kaloyan Spiridonov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment