# HG changeset patch # User sdrach # Date 1471976801 25200 # Node ID 12bb7768ae6eb94228d18df4cd34d6c4520ba95c # Parent 86086b4007861c005acc4d5517fbd0c7a48bcea6 8164585: JarFile::isMultiRelease does not return true in all cases where it should return true Reviewed-by: alanb, psandoz Contributed-by: steve.drach@oracle.com diff -r 86086b400786 -r 12bb7768ae6e jdk/src/java.base/share/classes/java/util/jar/JarFile.java --- a/jdk/src/java.base/share/classes/java/util/jar/JarFile.java Tue Aug 23 15:44:01 2016 -0700 +++ b/jdk/src/java.base/share/classes/java/util/jar/JarFile.java Tue Aug 23 11:26:41 2016 -0700 @@ -353,7 +353,7 @@ if (isMultiRelease) { return true; } - if (MULTI_RELEASE_ENABLED && versionMajor != BASE_VERSION_MAJOR) { + if (MULTI_RELEASE_ENABLED) { try { checkForSpecialAttributes(); } catch (IOException io) { @@ -644,7 +644,7 @@ return signers == null ? null : signers.clone(); } JarFileEntry realEntry() { - if (isMultiRelease()) { + if (isMultiRelease() && versionMajor != BASE_VERSION_MAJOR) { String entryName = super.getName(); return entryName.equals(this.name) ? this : new JarFileEntry(entryName, this); } @@ -960,7 +960,7 @@ hasClassPathAttribute = match(CLASSPATH_CHARS, b, CLASSPATH_LASTOCC) != -1; // is this a multi-release jar file - if (MULTI_RELEASE_ENABLED && versionMajor != BASE_VERSION_MAJOR) { + if (MULTI_RELEASE_ENABLED) { int i = match(MULTIRELEASE_CHARS, b, MULTIRELEASE_LASTOCC); if (i != -1) { i += MULTIRELEASE_CHARS.length; diff -r 86086b400786 -r 12bb7768ae6e jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java --- a/jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java Tue Aug 23 15:44:01 2016 -0700 +++ b/jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java Tue Aug 23 11:26:41 2016 -0700 @@ -80,7 +80,7 @@ } try (JarFile jf = new JarFile(multirelease)) { - Assert.assertFalse(jf.isMultiRelease()); + Assert.assertTrue(jf.isMultiRelease()); } try (JarFile jf = new JarFile(multirelease, true, ZipFile.OPEN_READ, Runtime.version())) {