From 4c6ba90fc34d64379af8e0f9e0574167e57f78ab Mon Sep 17 00:00:00 2001 From: "Marko A. Rodriguez" Date: Sat, 31 Oct 2015 10:54:52 -0600 Subject: [PATCH 1/2] bumped to support Neo4j 2.3.0 --- CHANGELOG.asciidoc | 3 ++- neo4j-gremlin/pom.xml | 28 +++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 8bd6e5118c4..06d0db4a9c3 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,10 +25,11 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/ TinkerPop 3.1.0 (NOT OFFICIALLY RELEASED YET) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +* Bumped to Neo4j 2.3.0. * Renamed the `public static String` configuration variable names of TinkerGraph (deprecated old variables). * Added `GraphComputer.config(key,value)` to allow engine-specific configurations. * `GraphStep` is no longer in the `sideEffect`-package and is now in `map`-package (breaking change). -* Added suppport for mid-traversal `V()`-steps (`GraphStep` semantics updated). +* Added support for mid-traversal `V()`-steps (`GraphStep` semantics updated). * Fixed `Number` handling in `Operator` enums. Prior this change a lot of operations on mixed `Number` types returned a wrong result (wrong data type). * Fixed a bug in Gremlin Server/Driver serializer where empty buffers were getting returned in certain cases. * Renamed `ConjunctionX` to `ConnectiveX` because "conjunction" is assumed "and" (disjunction "or"), where "connective" is the parent concept. diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml index 8661064e46d..eca07d1c8ee 100644 --- a/neo4j-gremlin/pom.xml +++ b/neo4j-gremlin/pom.xml @@ -136,7 +136,33 @@ limitations under the License. org.neo4j neo4j-tinkerpop-api-impl - 0.1-2.2 + 0.3-2.3.0 + test + + + org.apache.commons + commons-lang3 + + + com.googlecode.concurrentlinkedhashmap + concurrentlinkedhashmap-lru + + + org.scala-lang + scala-library + + + + + org.scala-lang + scala-library + 2.11.6 + test + + + com.googlecode.concurrentlinkedhashmap + concurrentlinkedhashmap-lru + 1.4.2 test From 1a31b78c4a158f7fcdbbf01f09d9d2801a12ab11 Mon Sep 17 00:00:00 2001 From: "Marko A. Rodriguez" Date: Sat, 31 Oct 2015 11:25:00 -0600 Subject: [PATCH 2/2] Tweaks to Neo4jHelper as NotFoundException should be checked as the reason for isNotFound() catch. Also, static String construction for cost savings. --- .../gremlin/neo4j/structure/Neo4jHelper.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java index 7c8c0d007eb..b2050198505 100644 --- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java +++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java @@ -19,16 +19,15 @@ package org.apache.tinkerpop.gremlin.neo4j.structure; import org.apache.tinkerpop.gremlin.structure.Direction; -import org.apache.tinkerpop.gremlin.structure.Element; -import org.apache.tinkerpop.gremlin.structure.Vertex; import org.neo4j.tinkerpop.api.Neo4jNode; -import org.neo4j.tinkerpop.api.Neo4jRelationship; /** * @author Marko A. Rodriguez (http://markorodriguez.com) */ public final class Neo4jHelper { + private static final String NOT_FOUND_EXCEPTION = "NotFoundException"; + private Neo4jHelper() { } @@ -45,13 +44,16 @@ public static boolean isDeleted(final Neo4jNode node) { try { node.getKeys(); return false; - } catch (final IllegalStateException e) { - return true; + } catch (final RuntimeException e) { + if (isNotFound(e)) + return true; + else + throw e; } } - public static boolean isNotFound(RuntimeException ex) { - return ex.getClass().getSimpleName().equals("NotFoundException"); + public static boolean isNotFound(final RuntimeException ex) { + return ex.getClass().getSimpleName().equals(NOT_FOUND_EXCEPTION); } public static Neo4jNode getVertexPropertyNode(final Neo4jVertexProperty vertexProperty) {