8211728: JarFile::versionedStream() does not filter META-INF resources in versioned stream
Reviewed-by: alanb
This commit is contained in:
parent
85c6642e38
commit
859d376494
@ -556,7 +556,8 @@ class JarFile extends ZipFile {
|
|||||||
return JUZFA.entryNameStream(this).map(this::getBasename)
|
return JUZFA.entryNameStream(this).map(this::getBasename)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.distinct()
|
.distinct()
|
||||||
.map(this::getJarEntry);
|
.map(this::getJarEntry)
|
||||||
|
.filter(Objects::nonNull);
|
||||||
}
|
}
|
||||||
return stream();
|
return stream();
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @bug 8163798 8189611
|
* @bug 8163798 8189611 8211728
|
||||||
* @summary basic tests for multi-release jar versioned streams
|
* @summary basic tests for multi-release jar versioned streams
|
||||||
* @library /test/lib
|
* @library /test/lib
|
||||||
* @modules jdk.jartool/sun.tools.jar java.base/jdk.internal.util.jar
|
* @modules jdk.jartool/sun.tools.jar java.base/jdk.internal.util.jar
|
||||||
@ -82,7 +82,8 @@ public class TestVersionedStream {
|
|||||||
"v10/p/Foo.class",
|
"v10/p/Foo.class",
|
||||||
"v10/q/Bar.class",
|
"v10/q/Bar.class",
|
||||||
"v" + LATEST_VERSION + "/p/Bar.class",
|
"v" + LATEST_VERSION + "/p/Bar.class",
|
||||||
"v" + LATEST_VERSION + "/p/Foo.class"
|
"v" + LATEST_VERSION + "/p/Foo.class",
|
||||||
|
"v" + LATEST_VERSION + "/META-INF/Foo.class"
|
||||||
);
|
);
|
||||||
|
|
||||||
jar("cf mmr.jar -C base . " +
|
jar("cf mmr.jar -C base . " +
|
||||||
@ -224,6 +225,11 @@ public class TestVersionedStream {
|
|||||||
throw new UncheckedIOException(x);
|
throw new UncheckedIOException(x);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!unversionedEntryNames.contains("META-INF/Foo.class") ||
|
||||||
|
versionedNames.indexOf("META-INF/Foo.class") != -1) {
|
||||||
|
Assert.fail("versioned META-INF/Foo.class test failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user