andreachild commented on code in PR #3244:
URL: https://github.com/apache/tinkerpop/pull/3244#discussion_r2446224042


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/ChooseStep.java:
##########
@@ -120,6 +120,8 @@ public void addChildOption(final M pickToken, final 
Traversal.Admin<S, E> traver
             } else if (pickToken == Pick.none && 
!this.traversalPickOptions.containsKey(Pick.none)) {
                 super.addChildOption(pickToken, traversalOption);
             }
+        } else if (pickToken instanceof Traversal) {
+            throw new IllegalArgumentException("Traversal is not allowed as a 
Pick token for choose().option()");

Review Comment:
   Nit: would be cleaner to consolidate all validation logic into the beginning 
of this method instead of spread out throughout the method.



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

Reply via email to