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

searching for a versioned entry in a multi-release jar in hotspot is inconsistent with java code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • hotspot
    • None
    • b156
    • generic
    • generic

        In the Java code, in the JarFile, if the version specified by the property -Djdk.util.jar.version is less than the "base version" (set to 8), it doesn't search for a versioned entry. See the following method (http://hg.openjdk.java.net/jdk9/dev/jdk/file/5c7dda0aa8ce/src/java.base/share/classes/java/util/jar/JarFile.java#l567):

            private ZipEntry getVersionedEntry(ZipEntry ze) {
                ZipEntry vze = null;
                if (BASE_VERSION_MAJOR < versionMajor) {
                    String name = ze.getName();
                    if (!name.startsWith(META_INF)) {
                        vze = searchForVersionedEntry(versionMajor, name);
                    }
                }
                return vze == null ? ze : vze;
            }

        In the hotspot code, in ClassPathZipEntry::open_versioned_entry(), we have another condition not searching for a versioned entry:
            if (version < base_version || version > cur_ver)
        This check should be removed, so that the hotspot code is consistent with the Java code.

              ccheung Calvin Cheung
              ccheung Calvin Cheung
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: