Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-3058

StackOverFlowError when using `or` in Custom Gremlin DSL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.6.4
    • None
    • tinkergraph
    • None

    Description

      Implementing our own GremlinDSL we encounter a `StackoverFlowError` as soon as we use `or` in the @GremlinDsl interface.

      The same condition works fine if defined directly in the query.
      It also works as soon as we remove the or from the condition.

      @GremlinDsl(traversalSource = "com.corp.foo.gremlin.CustomGraphTraversalSource")
      public interface CustomTraversalDsl<S, E> extends GraphTraversal.Admin<S, E> {
      
          default GraphTraversal<S, Vertex> outWithOr() {
              return out()
                  .or(
                      has("key"),
                      has("key", false)
                  );
          }
      
          default GraphTraversal<S, Vertex> outWithoutOr() {
              return out()
                  .has("key")
                  .has("key", false);
          }
      }
      
      g.V().where(outWithoutOr()).next(); -> works fine 
      
      g.V().where(out().or(has("key"), has("key", false))).next() -> works fine
      
      g.V().where(outWithOr()).next(); -> 
      
      java.lang.StackOverflowError
      	at org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper.hasStepOfAssignableClass(TraversalHelper.java:349)
      	at org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ConnectiveStrategy.apply(ConnectiveStrategy.java:63)
      	at org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper.applyTraversalRecursively(TraversalHelper.java:503)
      	at org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper.applyTraversalRecursively(TraversalHelper.java:491)

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            gruess Jan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: