tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [2/4] tinkerpop git commit: TINKERPOP-1811 Improve error messaging on failed bytecode translation
Date Thu, 30 Nov 2017 12:32:04 GMT
TINKERPOP-1811 Improve error messaging on failed bytecode translation


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

Branch: refs/heads/master
Commit: bc919cbe405f66cac0459e755d9a164069fe8d3e
Parents: 95a6ea3
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Thu Nov 30 06:40:47 2017 -0500
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Thu Nov 30 06:40:47 2017 -0500

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bc919cbe/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
index 79b24aa..c39ee23 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
@@ -176,8 +176,10 @@ public final class JavaTranslator<S extends TraversalSource, T extends
Traversal
 
         // without this initial check iterating an invalid methodName will lead to a null
pointer and a less than
         // great error message for the user. 
-        if (!methodCache.containsKey(methodName))
-            throw new IllegalStateException("Could not locate method: " + delegate.getClass().getSimpleName()
+ "." + methodName + "(" + Arrays.toString(argumentsCopy) + ")");
+        if (!methodCache.containsKey(methodName)) {
+            final String methodArgs = argumentsCopy.length > 0 ? Arrays.toString(argumentsCopy)
: "";
+            throw new IllegalStateException("Could not locate method: " + delegate.getClass().getSimpleName()
+ "." + methodName + "(" + methodArgs + ")");
+        }
 
         try {
             for (final Method method : methodCache.get(methodName)) {


Mime
View raw message