Cole-Greer commented on code in PR #3157:
URL: https://github.com/apache/tinkerpop/pull/3157#discussion_r2281156519
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/P.java:
##########
@@ -90,17 +156,18 @@ public boolean equals(final Object other) {
return other instanceof P &&
((P) other).getClass().equals(this.getClass()) &&
((P) other).getBiPredicate().equals(this.biPredicate) &&
- ((((P) other).getOriginalValue() == null && this.originalValue
== null) || ((P) other).getOriginalValue().equals(this.originalValue));
+ ((((P) other).variables == null && this.variables == null) ||
(((P) other).variables != null && ((P)
other).variables.equals(this.variables))) &&
+ ((((P) other).literals == null && this.literals == null) ||
(((P) other).literals != null && CollectionUtils.isEqualCollection(((P)
other).literals, this.literals)));
}
@Override
public String toString() {
- return null == this.originalValue ? this.biPredicate.toString() :
this.biPredicate.toString() + "(" + this.originalValue + ")";
+ return literals.isEmpty() && variables.isEmpty() ?
this.biPredicate.toString() : this.biPredicate.toString() + "(" + getValue() +
")";
Review Comment:
I considered that earlier. I think `eq(null)` is more clear than the
previous behaviour although it is a slight break. I don't mind changing this to
something like this to avoid the breaking change though:
```
return null == this.getValue() ? this.biPredicate.toString() :
this.biPredicate.toString() + "(" + this.getValue() + ")";
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]