Fix ExprEquivalence exception which seems to occur in some VE expressions.
Note -- I'm not sure what this is here for, and I'm also not sure if this equivalence check is sufficient.
@@ -104,6 +104,11 @@ public final class ExprEquivalence extends Equivalence<ExprNode> {
return Objects.hash(node.getProtoName(), protoInitFields(node));
}
+ @Override
+ protected Integer visitVeLiteralNode(VeLiteralNode node) {
+ return Objects.hash(node.getId(), node.getName(), node.getType().toString());
+ }
+
@Override
protected Integer visitBooleanNode(BooleanNode node) {
return Boolean.valueOf(node.getValue()).hashCode();
@@ -229,6 +234,14 @@ public final class ExprEquivalence extends Equivalence<ExprNode> {
return protoInitFields(node).equals(protoInitFields(otherNode));
}
+ @Override
+ protected Boolean visitVeLiteralNode(VeLiteralNode node) {
+ VeLiteralNode otherNode = (VeLiteralNode) other;
+ return node.getId().equals(otherNode.getId())
+ && node.getName().equals(otherNode.getName())
+ && node.getType().toString().equals(otherNode.getType().toString());
+ }
+
@Override
protected Boolean visitBooleanNode(BooleanNode node) {
return node.getValue() == ((BooleanNode) other).getValue();
