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

Bytecode.java flattenArguments throw exception when null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.3
    • 3.3.9, 3.4.4, 3.5.0
    • process
    • None

    Description

      In Bytecode.java,  current flattenArguments function  will trigger NPE exception when == null, which effect all version later from 3.3.3

      private final Object[] flattenArguments(final Object... arguments)

      Unknown macro: {     if (arguments.length == 0)           return EMPTY_ARRAY; }

       

      Recurrent step:

      1. with TinkerGraph.Mordern Graph
      2. gremlin> g.V(1).outE(null)gremlin> g.V(1).outE(null)java.lang.NullPointerExceptionType ':help' or ':h' for help.Display stack trace? [yN]y
        java.lang.NullPointerException at org.apache.tinkerpop.gremlin.process.traversal.Bytecode.flattenArguments(Bytecode.java:265) at org.apache.tinkerpop.gremlin.process.traversal.Bytecode.addStep(Bytecode.java:84) at org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal.outE(GraphTraversal.java:394) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            3. but when has more arguments, it could produce results correctly

      remlin> g.V(1).outE("knows", null)
      ==>e[7][1-knows->2]
      ==>e[8][1-knows->4]

      Attachments

        Activity

          People

            spmallette Stephen Mallette
            Stark Arya Stark Arya
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: