Copilot commented on code in PR #990:
URL: https://github.com/apache/fesod/pull/990#discussion_r3725870343
##########
fesod-examples/fesod-sheet-examples/src/main/java/org/apache/fesod/sheet/examples/util/ExampleDataGenerator.java:
##########
@@ -55,7 +55,7 @@ public static List<Date> generateDates(int count) {
List<Date> list = new ArrayList<>();
long now = System.currentTimeMillis();
for (int i = 0; i < count; i++) {
- list.add(new Date(now + i * 1000 * 60 * 60 * 24));
+ list.add(new Date(now + i * 1000 * 60 * 60 * 24L));
Review Comment:
`i * 1000 * 60 * 60 * 24L` still performs several intermediate
multiplications as `int` (left-to-right), so it can overflow before the final
`long` promotion (e.g., for larger `count`). Make the arithmetic `long` from
the start (and simplify the expression) to avoid intermediate overflow.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]