Github user jorgebay commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/753#discussion_r154010923
--- Diff:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
---
@@ -173,6 +173,12 @@ private Object invokeMethod(final Object delegate,
final Class returnType, final
for (int i = 0; i < arguments.length; i++) {
argumentsCopy[i] = translateObject(arguments[i]);
}
+
+ // 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) + ")");
--- End diff --
I agree, its more clear with empty parameters in the case of no method args.
---