Github user dkuppitz commented on a diff in the pull request:
https://github.com/apache/incubator-tinkerpop/pull/130#discussion_r43574102
--- Diff:
neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
---
@@ -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);
--- End diff --
There's probably a good reason for the `toString()` comparison, but
wouldn't it be easier/cleaner to do this:
```java
try {
node.getKeys();
return false;
} catch (NotFoundException e) {
return true;
}
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---