You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/01/12 17:32:13 UTC

incubator-tinkerpop git commit: Added the upper case versions of T accessors to invalid bindings.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 1d36fea23 -> ef40dce31


Added the upper case versions of T accessors to invalid bindings.

The ScriptEngine in Gremlin Server ignores scope so it includes private static variables from T for static imports.  Had to exclude those from being bindings so users get a nice error.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/ef40dce3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/ef40dce3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/ef40dce3

Branch: refs/heads/master
Commit: ef40dce314c1f9ee48661227d992beef8cad64d0
Parents: 1d36fea
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jan 12 11:30:33 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jan 12 11:30:33 2016 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                            | 1 +
 .../tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java  | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ef40dce3/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 2a19faa..8be3fe4 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -27,6 +27,7 @@ TinkerPop 3.1.1 (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 * The Spark persistence `StorageLevel` can now be set for both job graphs and `PersistedOutputRDD` data.
+* Added to the list of "invalid binding keys" allowed by Gremlin Server to cover the private fields of `T` which get exposed in the `ScriptEngine` on static imports.
 * Fixed a bug around duration calculations of `cap()`-step during profiling.
 * It is possible to completely avoid using HDFS with Spark if `PersistedInputRDD` and `PersistedOutpuRDD` are leveraged.
 * `InputRDD` and `OutputRDD` can now process both graphs and memory (i.e. sideEffects).

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ef40dce3/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
index 4d85822..aab9950 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
@@ -90,10 +90,15 @@ public abstract class AbstractEvalOpProcessor implements OpProcessor {
      * This may or may not be the full set of invalid binding keys.  It is dependent on the static imports made to
      * Gremlin Server.  This should get rid of the worst offenders though and provide a good message back to the
      * calling client.
+     * <p/>
+     * Use of {@code toUpperCase()} on the accessor values of {@link T} solves an issue where the {@code ScriptEngine}
+     * ignores private scope on {@link T} and imports static fields.
      */
     private static final List<String> invalidBindingsKeys = Arrays.asList(
             T.id.getAccessor(), T.key.getAccessor(),
-            T.label.getAccessor(), T.value.getAccessor());
+            T.label.getAccessor(), T.value.getAccessor(),
+            T.id.getAccessor().toUpperCase(), T.key.getAccessor().toUpperCase(),
+            T.label.getAccessor().toUpperCase(), T.value.getAccessor().toUpperCase());
     private static final String invalidBindingKeysJoined = String.join(",", invalidBindingsKeys);
 
     protected final boolean manageTransactions;