Sel-fish Finch created TINKERPOP-2201:
-----------------------------------------

             Summary: Gremlin-test failed while static type checking when use 
secure configuration
                 Key: TINKERPOP-2201
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2201
             Project: TinkerPop
          Issue Type: Bug
          Components: process
    Affects Versions: 3.4.1
            Reporter: Sel-fish Finch


Reproduce:
 1. Run Gremlin Server with `gremlin-server-secure.yaml` which use 
SimpleSandboxExtension for security
 2. Run Gremlin-test to verify the behavior

 

Among the other similar errors, take 
`*g_addV_asXfirstX_repeatXaddEXnextX_toXaddVX_inVX_timesX5X_addEXnextX_toXselectXfirstXX*`
 in `*features/map/AddEdge.feature*` as an example:
{code:java}
features/map/AddEdge.feature: 
g_addV_asXfirstX_repeatXaddEXnextX_toXaddVX_inVX_timesX5X_addEXnextX_toXselectXfirstXX
    And the traversal of
      GremlinServerError: 597: startup failed:
Script5.groovy: 1: [Static type checking] - Cannot call 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal 
<org.apache.tinkerpop.gremlin.structure.Vertex, 
org.apache.tinkerpop.gremlin.structure.Edge>#to(org.apache.tinkerpop.gremlin.process.traversal.Traversal
 <java.lang.Object extends java.lang.Object, 
org.apache.tinkerpop.gremlin.structure.Vertex>) with arguments 
[org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal <A 
extends java.lang.Object, B extends java.lang.Object>]
 @ line 1, column 1.
   
g.addV().as("first").repeat(__.addE("next").to(__.addV()).inV()).times(5).addE("next").to(__.select("first"))
   ^

1 error
{code}
In my knowledge, the reason is that static type checking will verify the class 
type of parameter, and the definition in `GraphTraversal` seems too strict for 
`SimpleSandboxExtension`.

As I changed the method definition:

{code:bash}
-    public default GraphTraversal<S, E> to(final Traversal<?, Vertex> 
toVertex) {
+    public default GraphTraversal<S, E> to(final Traversal<?, ?> toVertex) {
{code}

This previous case passed test.
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to