[
https://issues.apache.org/jira/browse/TINKERPOP-1962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16476433#comment-16476433
]
ASF GitHub Bot commented on TINKERPOP-1962:
-------------------------------------------
Github user dkuppitz commented on the issue:
https://github.com/apache/tinkerpop/pull/866
VOTE: +1
> GroovyTranslator doesn't handle empty maps
> ------------------------------------------
>
> Key: TINKERPOP-1962
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1962
> Project: TinkerPop
> Issue Type: Bug
> Components: server
> Affects Versions: 3.3.2
> Reporter: Dimitry Solovyov
> Assignee: stephen mallette
> Priority: Minor
> Fix For: 3.4.0, 3.3.4, 3.2.10
>
>
> Bytecode queries that contain an empty map and lambdas fail because
> GroovyTranslator doesn't account for empty maps when [removing the last
> trailing
> comma|https://github.com/apache/tinkerpop/blob/3.3.2/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java#L134].
> To reproduce:
> {code:java}
> gremlin> identity = new OneArgLambda('it.get()', 'gremlin-groovy')
> ==>lambda[it.get()]
> gremlin> bytecode = __.inject([:]).map(identity).asAdmin().getBytecode()
> ==>[[], [inject({}), map(lambda[it.get()])]]
> gremlin> client.submit(bytecode).all().get()
> org.apache.tinkerpop.gremlin.driver.exception.ResponseException:
> org.codehaus.groovy.control.MultipleCompilationErrorsException:
> Script9.groovy: 1: expecting ')', found ']' @ line 1, column 31.
> gremlinscriptengine__g.inject(]).map({it.get()})
> ^
> 1 error
> {code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)