Konstantin Müller created TINKERPOP-1957:
--------------------------------------------
Summary: Static Groovy script compilation requires long literals
in predicates
Key: TINKERPOP-1957
URL: https://issues.apache.org/jira/browse/TINKERPOP-1957
Project: TinkerPop
Issue Type: Bug
Components: groovy
Affects Versions: 3.3.2
Environment: GremlinGroovyScriptEngine with
GroovyCompilerGremlinPlugin and COMPILE_STATIC
Reporter: Konstantin Müller
When using the GremlinGroovyScriptEngine together with
GroovyCompilerGremlinPlugin and compilation option COMPILE_STATIC it is
required to use long literals instead of integer literals in predicates. For
example the following query fails during compilation:
{noformat}
g.V().where(outE().count().is(lt(50))){noformat}
This gives the following error message:
{noformat}
Script1.groovy: 1: [Static type checking] - Cannot call
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal
<org.apache.tinkerpop.gremlin.structure.Vertex,
java.lang.Long>#is(org.apache.tinkerpop.gremlin.process.traversal.P
<java.lang.Long>) with arguments
[org.apache.tinkerpop.gremlin.process.traversal.P <java.lang.Integer>]
@ line 1, column 13.
g.V().where(outE().count().is(lt(50)))
^
Script1.groovy: 1: [Static type checking] - Cannot find matching method
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal#where(java.lang.Object).
Please check if the declared type is correct and if the method exists.
@ line 1, column 1.
g.V().where(outE().count().is(lt(50))){noformat}
Changing the query to use long literals makes the query work:
{noformat}
g.V().where(outE().count().is(lt(50L))){noformat}
The original query works with version 3.2.8 or if COMPILE_STATIC is NOT used.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)