[8u][RFR][3/3] 6233323: ZipEntry.isDirectory() may return false incorrectly

Taylor, Ben benty at amazon.com
Thu Nov 12 20:15:08 UTC 2020


Hello,

This backport is a companion to 8145260 and 8157069.
Since the backport of 8145260 to 8u is dependent on ZipEntry.isDirectory()
for the behavior described in 8185136: Release Note:
java.util.zip.ZipFile.getEntry() now always returns the ZipEntry instance
with a '/' ended entry name for directory entry[1],
this should be backported at the same time.

Since the original commit for this bug included
8144977: Class.getResourceAsStream("directory") in JAR returns broken
InputStream[2][3],that bug has been backported as well.

The patch was modified slightly to ensure that the ensuretrailingslash
property is still respected.

Neither patch includes a test, but there is code to reproduce
on the JBS bugs, and both pass.

https://bugs.openjdk.java.net/browse/JDK-6233323
http://cr.openjdk.java.net/~cverghese/webrevs/6233323/webrev/

Thanks,
--Ben

[1] https://bugs.openjdk.java.net/browse/JDK-8185136
[2] http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/13d951aed7aa
[3] https://bugs.openjdk.java.net/browse/JDK-8144977


More information about the jdk8u-dev mailing list