RFR: 8276123: ZipFile::getEntry will not return a file entry when there is a directory entry of the same name within a Zip File
Jaikiran Pai
jpai at openjdk.java.net
Thu Nov 11 12:28:37 UTC 2021
On Thu, 11 Nov 2021 11:51:31 GMT, Lance Andersen <lancea at openjdk.org> wrote:
>> src/java.base/share/classes/java/util/zip/ZipFile.java line 1642:
>>
>>> 1640: && entry.startsWith(name) &&
>>> 1641: entry.charAt(entryLen - 1) == '/') {
>>> 1642: // Now check for a match with a trailing slash
>>
>> Hello Lance,
>> Is this a typo in that comment? Should it instead say "... without a trailing slash"?
>
> Hi Jaikiran,
>
> The comment is correct
Thank you for that clarification. The "addSlash" param being "false" in the call below that comment is what made me think that the comment had a typo. I read that code in a bit more detail now and I see what that comment means. It essentially says that it's now issuing a call to find a entry position (if it exists) for the name ending with a "/" character.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6342
More information about the core-libs-dev
mailing list