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/de1d58ab Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/de1d58ab Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/de1d58ab Branch: refs/heads/TINKERPOP-1642 Commit: de1d58ab33c3121e9bafb5e4908f3e0d76c8e26e Parents: 608f024 Author: Stephen Mallette <[email protected]> Authored: Wed Mar 8 13:37:42 2017 -0500 Committer: Stephen Mallette <[email protected]> Committed: Fri Mar 10 11:12:36 2017 -0500 ---------------------------------------------------------------------- .../groovy/jsr223/GremlinGroovyScriptEngine.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/de1d58ab/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); } });
