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

JarFile::isMultiRelease() method returns false when it should return true

    Details

    • Resolved In Build:
      b136

      Description

      The attached jar files have valid manifests:

      multirelease-0.8-SNAPSHOT_failure.jar
      -----------------------------------------------------
      Manifest-Version: 1.0
      Archiver-Version: Plexus Archiver
      Created-By: Apache Maven 3.3.9
      Built-By: scholterf
      Build-Jdk: 9-ea
      Multi-Release: true

      multirelease-0.8-SNAPSHOT_success.jar
      --------------------------------------------------------
      Manifest-Version: 1.0
      Archiver-Version: Plexus Archiver
      Created-By: Apache Maven 3.4.0-SNAPSHOT
      Built-By: scholterf
      Build-Jdk: 9-ea
      Multi-Release: true

      Yet, JarFile thinks the "failure" jar does not have the "Multi-Release: true" attribute, demonstrated by

      jshell> /op script
      multirelease-0.8-SNAPSHOT_success.jar is multi-release? true
      multirelease-0.8-SNAPSHOT_failure.jar is multi-release? false

      jshell> /li

         1 : import java.util.jar.*;
         2 : File f = new File("multirelease-0.8-SNAPSHOT_success.jar");
         3 : JarFile jf = new JarFile(f, false, 1, JarFile.runtimeVersion());
         4 : System.out.println(f + " is multi-release? " + jf.isMultiRelease());
         5 : f = new File("multirelease-0.8-SNAPSHOT_failure.jar");
         6 : jf = new JarFile(f, false, 1, JarFile.runtimeVersion());
         7 : System.out.println(f + " is multi-release? " + jf.isMultiRelease());

      Further investigation shows that JarFile::match returns -1 for the "failure" jar.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                redestad Claes Redestad
                Reporter:
                sdrach Steve Drach (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: