Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8261237

remove isClassPathAttributePresent method

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: core-libs
    • Resolved In Build:
      b09
    • CPU:
      generic
    • OS:
      generic

      Description

      Currently in jdk/internal/vm/VMSupport.java , we create a JarFile without a related finally clause or try with resources. That should better be changed.
      See also the Sonar check result :

      https://sonarcloud.io/project/issues?id=shipilev_jdk&languages=java&open=AXcqM8zf8sPJZZzON5qG&resolved=false&severities=BLOCKER&types=BUG

          public static boolean isClassPathAttributePresent(String path) {
              try {
                  Manifest man = (new JarFile(path)).getManifest();
      Use try-with-resources or close this "JarFile" in a "finally" clause.Why is this an issue?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mbaesken Matthias Baesken
              Reporter:
              mbaesken Matthias Baesken
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: