From 90a5e8ad37bca75eb82d76e06bef5108453abcc0 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sat, 6 Jul 2024 15:03:48 -0400 Subject: [PATCH] Fix CodeQL Code scanning alerts Implicit narrowing conversion in compound assignment --- .../java/org/apache/commons/lang3/time/DurationFormatUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java b/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java index 18dc6a49d..01271bff1 100644 --- a/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java +++ b/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java @@ -534,7 +534,7 @@ public class DurationFormatUtils { end.setTime(new Date(endMillis)); // initial estimates - int milliseconds = end.get(Calendar.MILLISECOND) - start.get(Calendar.MILLISECOND); + long milliseconds = end.get(Calendar.MILLISECOND) - start.get(Calendar.MILLISECOND); int seconds = end.get(Calendar.SECOND) - start.get(Calendar.SECOND); int minutes = end.get(Calendar.MINUTE) - start.get(Calendar.MINUTE); int hours = end.get(Calendar.HOUR_OF_DAY) - start.get(Calendar.HOUR_OF_DAY);