AmarGhugare opened a new pull request, #1882: URL: https://github.com/apache/commons-lang/pull/1882
`DurationUtils.accept` combines `Duration.toMillis()` with a non-negative nanosecond remainder. On current JDKs, negative milliseconds truncate toward zero, so these components no longer represent the input duration. For example, `Duration.ofNanos(-1)` reaches the callback as `(0, 999999)`, a positive duration. This also makes `ThreadUtils.sleep` and `join` accept some negative timeouts. Remove the nanosecond remainder before converting a negative duration to milliseconds. This keeps the decomposition correct across Java 8 and newer JDK rounding behavior while preserving the normal positive conversion path. The Javadoc now describes the component relationship. Eight regression executions fail before the fix on JDK 25. Tests cover negative, zero, and positive durations, millisecond boundaries, and the public sleep/join behavior. No public API is added. Validation: 132 focused tests, Checkstyle, and SpotBugs pass. Full required Maven build: 118174 tests, zero failures/errors, 29 skipped; coverage, license, Checkstyle, binary compatibility, SpotBugs, PMD, and Javadoc checks pass. Jira filing is pending account approval. -- 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]
