You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Sel-fish Finch (JIRA)" <ji...@apache.org> on 2019/04/25 01:26:00 UTC

[jira] [Updated] (TINKERPOP-2201) Gremlin-test failed while static type checking when use secure configuration

     [ https://issues.apache.org/jira/browse/TINKERPOP-2201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sel-fish Finch updated TINKERPOP-2201:
--------------------------------------
    Description: 
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}

The mentioned case passed.
 

  was:
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.
 


> 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
>            Priority: Minor
>
> 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}
> The mentioned case passed.
>  



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