gitgabrio commented on code in PR #5907:
URL: 
https://github.com/apache/incubator-kie-drools/pull/5907#discussion_r1593799426


##########
drools-drl/drools-drl-parser/src/main/java/org/drools/drl/parser/antlr4/DRLVisitorImpl.java:
##########
@@ -803,12 +803,19 @@ public AccumulateDescr 
visitFromAccumulate(DRLParser.FromAccumulateContext ctx)
     @Override
     public AccumulateDescr.AccumulateFunctionCallDescr 
visitAccumulateFunction(DRLParser.AccumulateFunctionContext ctx) {
         String function = ctx.drlIdentifier().getText();
-        String bind = ctx.label() == null ? null : 
ctx.label().drlIdentifier().getText();
+        String bind = null;
+        boolean unify = false;
+        if (ctx.label() != null) {

Review Comment:
   Thanks @yurloc !
   But, if 
   "ctx.label() and ctx.unify() can't be both non-null. " 
   then, all the versions discussed until now (even the original one in the PR) 
skip such check, silently swalloping up the fact that both are `null`:
   
   ```java
           String bind = null;
           boolean unify = false;
           if (ctx.label() != null) {
               bind = ctx.label().drlIdentifier().getText();
           } else if (ctx.unif() != null) {
               bind = ctx.unif().drlIdentifier().getText();
               unify = true;
           }
   ```
   
   If at least one of them has to be not null, then a different approach is 
required... guys, I didn't thought to get so far 😄 
   
   



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