Skip to content

Commit

Permalink
Fix reverse traversal of bothE and bothV in MATCH execution
Browse files Browse the repository at this point in the history
Resolves: #8915
  • Loading branch information
luigidellaquila committed Jun 26, 2019
1 parent c645f6b commit 1164311
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class OMethodCall extends SimpleNode {
Arrays.asList(new String[] { "out", "in", "both", "outE", "inE", "bothE", "bothV", "outV", "inV" }));

static Set<String> bidirectionalMethods = new HashSet<String>(
Arrays.asList(new String[] { "out", "in", "both", "oute", "ine", "inv", "outv" }));
Arrays.asList(new String[] { "out", "in", "both", "oute", "ine", "inv", "outv", "bothe", "bothv" }));

protected OIdentifier methodName;
protected List<OExpression> params = new ArrayList<OExpression>();
Expand Down Expand Up @@ -157,6 +157,14 @@ public Object executeReverse(Object targetObjects, OCommandContext ctx) {
return execute(targetObjects, ctx, "inE", params, null);
}

if (straightName.equalsIgnoreCase("bothE")) {
return execute(targetObjects, ctx, "bothV", params, null);
}

if (straightName.equalsIgnoreCase("bothV")) {
return execute(targetObjects, ctx, "bothE", params, null);
}

throw new UnsupportedOperationException("Invalid reverse traversal: " + methodName);
}

Expand Down

0 comments on commit 1164311

Please sign in to comment.