Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8174329 | 10 | Calvin Cheung | P3 | Resolved | Fixed | b01 |
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.
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.
- backported by
-
JDK-8174329 searching for a versioned entry in a multi-release jar in hotspot is inconsistent with java code
-
- Resolved
-