hiSandog opened a new pull request, #25994:
URL: https://github.com/apache/pulsar/pull/25994

   ## Motivation
   RelativeTimeUtil.nsToSeconds currently builds a BigDecimal from a double. 
For half-up rounding cases such as 1.2345 seconds, the binary double value can 
be slightly below the decimal half and round down unexpectedly.
   
   ## Modifications
   - Convert nanoseconds with BigDecimal.valueOf(ns, 9) so the decimal value is 
exact before rounding.
   - Apply the same fix to both common and cli-utils RelativeTimeUtil 
implementations.
   - Add coverage for a half-up rounding boundary.
   
   ## Verifications
   - git diff --check
   - Not run: ./gradlew :pulsar-common:test --tests 
"org.apache.pulsar.common.util.RelativeTimeUtilTest" -PtestRetryCount=0 (local 
environment has no Java Runtime)


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