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


##########
kie-dmn/kie-dmn-model/src/main/java/org/kie/dmn/model/impl/AbstractTDefinitions.java:
##########
@@ -149,6 +149,6 @@ public void setExporterVersion(String value) {
      */
     @Override
     public List<DecisionService> getDecisionService() {
-        return 
drgElement.stream().filter(DecisionService.class::isInstance).map(DecisionService.class::cast).collect(Collectors.toList());
+        return 
getDrgElement().stream().filter(DecisionService.class::isInstance).map(DecisionService.class::cast).collect(Collectors.toList());

Review Comment:
   `getDecisionService()` now calls `getDrgElement()`, which eagerly 
initializes (mutates) the underlying `drgElement` list when it was previously 
`null`. Since `getDecisionService()` is a derived view, it’s safer to avoid 
changing object state just to compute the result; this also avoids surprising 
side-effects for callers that only want to read decision services.



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