On Mon, 26 Jan 2026 10:23:16 GMT, Eirik Bjørsnøs <[email protected]> wrote:
> Please review this small enhancement which makes `ZipFile.Source.Key` capture > the relevant `BasicFileAttributes` fields eagerly in its constructor instead > of calling into `BasicFileAttributes` for each `hashCode` or `equals` > invocation. > > This reduces the memory footprint of `Key` instances. It should be > performance positive since we avoid creating `FileTime` instances once per > comparison and avoid synchronization getting the file key. > > Capturing fields early also improves readability by making it obvious from > the field declarations what information Key uses when comparing equality. > > Pure refactoring, no tests updated, `noreg-trivial`. This pull request has now been integrated. Changeset: e0445c09 Author: Eirik Bjørsnøs <[email protected]> URL: https://git.openjdk.org/jdk/commit/e0445c09f7a967843a56634f72c7545446791e15 Stats: 15 lines in 1 file changed: 5 ins; 2 del; 8 mod 8376294: ZipFile.Source.Key should not hold on to its BasicFileAttributes instance Reviewed-by: jpai ------------- PR: https://git.openjdk.org/jdk/pull/29411
