[ 
https://issues.apache.org/jira/browse/TINKERPOP-1962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16473524#comment-16473524
 ] 

ASF GitHub Bot commented on TINKERPOP-1962:
-------------------------------------------

GitHub user spmallette opened a pull request:

    https://github.com/apache/tinkerpop/pull/866

    TINKERPOP-1962 GroovyTranslator handles empty maps properly now.

    https://issues.apache.org/jira/browse/TINKERPOP-1962
    
    Pretty self-explanatory change....easy fix.
    
    All tests pass with `docker/build.sh -t -i`
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1962

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/866.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #866
    
----
commit 4e8b4cff058298d0cb43be1402a14d77f22a53ac
Author: Stephen Mallette <spmva@...>
Date:   2018-05-09T13:16:45Z

    TINKERPOP-1962 GroovyTranslator handles empty maps properly now.

----


> 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)

Reply via email to