gnodet opened a new pull request, #12797: URL: https://github.com/apache/maven/pull/12797
## Backport of #12753 Cherry-pick of #12753 onto `maven-4.0.x`. **Original PR:** #12753 - fix(api-core): properly implement Clock.withZone() in MonotonicClock **Original author:** @poliglots **Target branch:** `maven-4.0.x` ### Original description Fix issue #12608: MonotonicClock.withZone() was ignoring the zone parameter and returning 'this', violating the java.time.Clock contract. Changes: - Add a 'zone' field to track timezone per instance - Implement withZone() to create a new clock variant with the requested timezone, preserving monotonic timing - Update getZone() to return the instance's actual zone - Throw NullPointerException on null zone (per JDK Clock convention) - Add tests verifying withZone() returns a new instance with correct zone and that monotonic timing is preserved The singleton instance continues to use UTC. Creating timezone variants does not compromise monotonicity since Instant is timezone-agnostic and monotonicity derives from System.nanoTime(). 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
