Copilot commented on code in PR #6394:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6394#discussion_r2199970768


##########
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/util/EvalHelper.java:
##########
@@ -109,6 +115,9 @@ public static PropertyValueResult getDefinedValue(final 
Object current, final St
                 case "months":
                     result = ((ChronoPeriod) current).get(ChronoUnit.MONTHS) % 
12;
                     break;
+                case "value":
+                    result = ((ChronoPeriod) current).get(ChronoUnit.YEARS) * 
12 + ((ChronoPeriod) current).get(ChronoUnit.MONTHS);

Review Comment:
   Instead of manually computing years * 12 + months, consider using 
Period.toTotalMonths() (if `current` is a `Period`) or another ChronoPeriod 
helper method to get the total months directly. This improves readability and 
reduces potential off-by-one logic.
   ```suggestion
                       result = ((ChronoPeriod) current).toTotalMonths();
   ```



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

Reply via email to