makarandhinge commented on PR #1609:
URL: https://github.com/apache/commons-lang/pull/1609#issuecomment-3941322831

   Thank you @garydgregory for the clarification.
   
   I tested the behavior without the year safeguard.
   When rounding new Date(Long.MAX_VALUE), the internal Calendar.add() causes a 
long overflow, resulting in a wrapped negative millisecond value (e.g., 
-9223372036854771616).
   
   So while new Date(Long.MAX_VALUE) is legal, performing rounding operations 
on it can lead to silent overflow and corrupted results.
   
   The existing safeguard (year > 280000000) appears to intentionally prevent 
such undefined arithmetic behavior.
   
   Given this behavior, the existing safeguard appears to prevent silent 
overflow during arithmetic operations.
   I would appreciate your guidance on whether the tests should be adjusted 
accordingly, or if you would prefer a different approach to the implementation.


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