[
https://issues.apache.org/jira/browse/TINKERPOP-2040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16628686#comment-16628686
]
ASF GitHub Bot commented on TINKERPOP-2040:
-------------------------------------------
GitHub user spmallette opened a pull request:
https://github.com/apache/tinkerpop/pull/941
TINKERPOP-2040 Improve flexibility of GroovyTranslator to handle custom
types
https://issues.apache.org/jira/browse/TINKERPOP-2040
Handled all of the core GraphSON types in the `GroovyTranslator`. Included
a new `TypeTranslator` to allow the behavior of the `ScriptTranslator` to be
modified and allowed the `GremlinGroovyScriptEngine` to accept a
`TranslatorCustomizer` to allow that custom `TypeTranslator` to be used.
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-2040
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/941.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 #941
----
commit b33c8c683d7e95cfccae07b20dccf54a83b5eba0
Author: Stephen Mallette <spmva@...>
Date: 2018-09-20T15:53:07Z
TINKERPOP-2040 Provide improved type handling for GroovyTranslator
Refactored testing and added support for UUID, Date, Timestamp as well as a
method to override standard type handling.
commit 873609bcb23552d033de91282bde3705f729fdc2
Author: Stephen Mallette <spmva@...>
Date: 2018-09-25T17:46:38Z
TINKERPOP-2040 Added more tests to cover more GraphSON types
commit 93d99ef1a0119b4c0994daeccaf312d45c894f45
Author: Stephen Mallette <spmva@...>
Date: 2018-09-25T21:29:49Z
TINKERPOP-2040 Hooked up Customizer for TypeTranslator
Enables the Groovy GremlinScriptEngine to use custom TypeTranslators
----
> Improve flexibility of GroovyTranslator to handle custom types
> --------------------------------------------------------------
>
> Key: TINKERPOP-2040
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2040
> Project: TinkerPop
> Issue Type: Improvement
> Components: groovy
> Affects Versions: 3.2.9
> Reporter: stephen mallette
> Assignee: stephen mallette
> Priority: Major
>
> {{GroovyTranslator}} only handles a set body of types. If for some reason
> however an object is passed to it in the traversal that it doesn't know how
> to properly handle you could get an invalid groovy string. It would be good
> if it could not only handle new types but also override existing ones (not
> sure why an override would be needed, but does't seem like a wrong thing to
> allow).
> This change is slightly bigger than {{GroovyTranslator}} though because
> however the override will take place it will need to be possible to use it
> within the script engine somehow and right now it is initialized statically.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)