You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by GitBox <gi...@apache.org> on 2021/07/07 11:47:10 UTC

[GitHub] [unomi] sergehuber commented on a change in pull request #321: UNOMI-188 Rule event type optimization

sergehuber commented on a change in pull request #321:
URL: https://github.com/apache/unomi/pull/321#discussion_r665294645



##########
File path: services/src/main/java/org/apache/unomi/services/impl/ParserHelper.java
##########
@@ -63,39 +63,41 @@ public void visit(Condition condition) {
                     }
                 }
             }
-        });
+        }, new Stack<>());
         return result.isEmpty();
     }
 
     public static List<String> getConditionTypeIds(Condition rootCondition) {
         final List<String> result = new ArrayList<String>();
         visitConditions(rootCondition, new ConditionVisitor() {
             @Override
-            public void visit(Condition condition) {
+            public void visit(Condition condition, Stack<String> conditionTypeStack) {
                 result.add(condition.getConditionTypeId());
             }
-        });
+        }, new Stack<>());
         return result;
     }
 
-    private static void visitConditions(Condition rootCondition, ConditionVisitor visitor) {
-        visitor.visit(rootCondition);
+    private static void visitConditions(Condition rootCondition, ConditionVisitor visitor, Stack<String> conditionTypeStack) {

Review comment:
       Yes I thought about a postVisit (I was experimenting with enter/leave pattern) but I thought the stack could be useful to more visitor implementations. But if we use a postVisit then it's pretty similar.




-- 
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: dev-unsubscribe@unomi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org