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/03/09 18:16:26 UTC
[06/15] tinkerpop git commit: TINKERPOP-1644 Minor code format updates
TINKERPOP-1644 Minor code format updates
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2a7314d8
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2a7314d8
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2a7314d8
Branch: refs/heads/TINKERPOP-1644
Commit: 2a7314d8a75fe9475cc4d55feb6fd8a62c2dd95d
Parents: 5cef755
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Mar 8 13:37:42 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Mar 9 13:16:10 2017 -0500
----------------------------------------------------------------------
.../groovy/jsr223/GremlinGroovyScriptEngine.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2a7314d8/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
index cadc3b0..42d954a 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
@@ -164,20 +164,20 @@ public class GremlinGroovyScriptEngine extends GroovyScriptEngineImpl
/**
* Script to generated Class map.
*/
- private LoadingCache<String, Future<Class>> classMap = Caffeine.newBuilder().softValues().build(new CacheLoader<String, Future<Class>>() {
+ private final LoadingCache<String, Future<Class>> classMap = Caffeine.newBuilder().softValues().build(new CacheLoader<String, Future<Class>>() {
@Override
- public Future<Class> load(String script) throws Exception {
- long start = System.currentTimeMillis();
+ public Future<Class> load(final String script) throws Exception {
+ final long start = System.currentTimeMillis();
return CompletableFuture.supplyAsync(() -> {
try {
return loader.parseClass(script, generateScriptName());
} catch (CompilationFailedException e) {
- long finish = System.currentTimeMillis();
+ final long finish = System.currentTimeMillis();
log.error("Script compilation FAILED {} took {}ms {}", script, finish - start, e);
throw e;
} finally {
- long time = System.currentTimeMillis() - start;
+ final long time = System.currentTimeMillis() - start;
if (time > 5000) {
//We warn if a script took longer than a few seconds. Repeatedly seeing these warnings is a sign that something is wrong.
//Scripts with a large numbers of parameters often trigger this and should be avoided.
@@ -186,7 +186,7 @@ public class GremlinGroovyScriptEngine extends GroovyScriptEngineImpl
log.debug("Script compilation {} took {}ms", script, time);
}
}
- }, command -> command.run());
+ }, Runnable::run);
}
});