opwvhk commented on code in PR #3765:
URL: https://github.com/apache/avro/pull/3765#discussion_r3214850073
##########
lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflect.java:
##########
@@ -1416,4 +1417,55 @@ void avroDoc() {
+ "{\"name\":\"foo\",\"type\":\"int\",\"doc\":\"Some
Documentation\"}" + "]}");
}
+ // test recursive record schema
+ public static class TreeNode {
+ public int value = 0;
+ @Nullable
+ public TreeNode left;
+ @Nullable
+ public TreeNode right;
+
+ public TreeNode() {
+ }
+
+ public TreeNode(int value) {
+ this.value = value;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof TreeNode))
+ return false;
+ TreeNode that = (TreeNode) o;
+ if (value != that.value || !Objects.equals(left, that.left) ||
!Objects.equals(right, that.right))
+ return false;
+ return true;
+ }
Review Comment:
```suggestion
}
@Override
public int hashCode() {
return Objects.hash(value, left, right);
}
```
--
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]