You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2025/03/28 17:18:28 UTC

(tinkerpop) 01/03: Earlier check for missing repeat() traversal CTR

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 94dda413f627d98c296664daca62c9ba552f34ac
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Fri Mar 28 13:17:31 2025 -0400

    Earlier check for missing repeat() traversal CTR
---
 .../strategy/verification/StandardVerificationStrategy.java          | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
index 5a41c92f7b..33bf519252 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
@@ -64,6 +64,11 @@ public final class StandardVerificationStrategy extends AbstractTraversalStrateg
             }
             if (step instanceof ReducingBarrierStep && step.getTraversal().getParent() instanceof RepeatStep && step.getTraversal().getParent().getGlobalChildren().get(0).getSteps().contains(step))
                 throw new VerificationException("The parent of a reducing barrier can not be repeat()-step: " + step, traversal);
+
+            // prevents silly stuff like g.V().emit()
+            if (step instanceof RepeatStep && null == ((RepeatStep) step).getRepeatTraversal())
+                throw new VerificationException("The repeat()-traversal was not defined:" + traversal, traversal);
+
         }
 
         // The ProfileSideEffectStep must be one of the following