garydgregory commented on code in PR #433:
URL: https://github.com/apache/commons-beanutils/pull/433#discussion_r3740739032


##########
src/main/java/org/apache/commons/beanutils2/converters/DateTimeConverter.java:
##########
@@ -200,7 +200,7 @@ protected <T> T convertToType(final Class<T> targetType, 
final Object value) thr
             // didn't include the milliseconds. The following code
             // ensures it works consistently across JDK versions
             final java.sql.Timestamp timestamp = (java.sql.Timestamp) value;
-            long timeInMillis = timestamp.getTime() / 1000 * 1000;
+            long timeInMillis = Math.floorDiv(timestamp.getTime(), 1000) * 
1000;
             timeInMillis += timestamp.getNanos() / 1000000;
             return toDate(targetType, timeInMillis);

Review Comment:
   Hello @rootvector2 
   Please review Copiolot's comment. The comment suggests we are also missing a 
unit tests for the path Copilot found. Please verify and provide an additional 
test.
   Thank you!
   



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