RFR: 8317678: Fix up hashCode() for ZipFile.Source.Key [v7]
Alan Bateman
alanb at openjdk.org
Wed Oct 18 12:13:00 UTC 2023
On Wed, 18 Oct 2023 10:09:29 GMT, Sean Coffey <coffeys at openjdk.org> wrote:
>> Fix up java.util.zip.ZipFile$Source hashCode() impl so that duplicate Source objects aren't created for the same zip file.
>
> Sean Coffey has updated the pull request incrementally with one additional commit since the last revision:
>
> Testcase feedback from Lance
src/java.base/share/classes/java/util/zip/ZipFile.java line 1415:
> 1413: * an existing file is updated. The other hash code properties
> 1414: * by themselves won't detect such a change.
> 1415: */
I see you've added a comment to the checking of the last modified time but I think the comment is a bit confusing as there isn't any detection of a changed zip file in the hashCode/equals methods. I think you want to say that the lastModifiedTime is included in the hash code to allow for cases where the same file is opened more than once and where it has been modified in the mean-time.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16115#discussion_r1363754433
More information about the core-libs-dev
mailing list