elharo opened a new issue, #12608:
URL: https://github.com/apache/maven/issues/12608

   # MonotonicClock.withZone() ignores zone parameter, violating Clock contract
   
   **Found in:** maven-4.0.x branch
   **File:** 
`api/maven-api-core/src/main/java/org/apache/maven/api/MonotonicClock.java` 
(lines 147-150)
   **Severity:** Low
   
   ## Description
   
   `withZone()` ignores the zone parameter and returns `this`, violating the 
`java.time.Clock.withZone()` contract:
   
   ```java
   @Override
   public Clock withZone(ZoneId zone) {
       return this;    // ignores the zone parameter
   }
   ```
   
   The `Clock.withZone()` contract states: "Returns a copy of this clock with a 
different time-zone. The returned clock is functionally equivalent to this 
clock but with the specified time-zone." Ignoring the parameter and returning 
`this` means callers that pass a specific timezone expecting a clock in that 
zone will silently get UTC instead, leading to subtle timezone bugs.


-- 
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]

Reply via email to