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 2017/01/23 12:33:28 UTC

[1/2] tinkerpop git commit: Fixed and simplified 'language not supported' formatting

Repository: tinkerpop
Updated Branches:
  refs/heads/master e817fbcfd -> b4f552f91


Fixed and simplified 'language not supported' formatting


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

Branch: refs/heads/master
Commit: f84f454ec456ec0d3ad39fc01c0d71b1fa217d4b
Parents: 62785dc
Author: Joshua Shinavier <jo...@fortytwo.net>
Authored: Fri Jan 20 22:24:29 2017 -0800
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jan 23 07:32:23 2017 -0500

----------------------------------------------------------------------
 .../tinkerpop/gremlin/groovy/engine/ScriptEngines.java  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f84f454e/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/ScriptEngines.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/ScriptEngines.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/ScriptEngines.java
index 6911419..7dcfc5c 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/ScriptEngines.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/ScriptEngines.java
@@ -110,8 +110,7 @@ public class ScriptEngines implements AutoCloseable {
      * Evaluate a script with {@code Bindings} for a particular language.
      */
     public Object eval(final String script, final Bindings bindings, final String language) throws ScriptException {
-        if (!scriptEngines.containsKey(language))
-            throw new IllegalArgumentException(String.format("Language [%s] not supported", language));
+        checkLanguageIsSupported(language);
 
         awaitControlOp();
 
@@ -126,8 +125,7 @@ public class ScriptEngines implements AutoCloseable {
      */
     public Object eval(final Reader reader, final Bindings bindings, final String language)
             throws ScriptException {
-        if (!scriptEngines.containsKey(language))
-            throw new IllegalArgumentException("Language [%s] not supported");
+        checkLanguageIsSupported(language);
 
         awaitControlOp();
 
@@ -454,4 +452,10 @@ public class ScriptEngines implements AutoCloseable {
         all.putAll(bindings);
         return all;
     }
+
+    private void checkLanguageIsSupported(final String language) {
+        if (!scriptEngines.containsKey(language)) {
+            throw new IllegalArgumentException(String.format("Language [%s] not supported", language));
+        }
+    }
 }


[2/2] tinkerpop git commit: Merge branch 'tp32'

Posted by sp...@apache.org.
Merge branch 'tp32'


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

Branch: refs/heads/master
Commit: b4f552f915fabf570ea024b408986f16c37d8c37
Parents: e817fbc f84f454
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jan 23 07:32:34 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jan 23 07:32:34 2017 -0500

----------------------------------------------------------------------

----------------------------------------------------------------------