Skip to content

Commit 0194a6f

Browse files
committed
fix custom eq
1 parent 0c8e34c commit 0194a6f

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

Diff for: lib/src/main/java/io/cloudquery/scalar/Binary.java

+6-12
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,13 @@ public void setValue(Object value) throws ValidationException {
4949

5050
@Override
5151
public boolean equals(Object other) {
52-
if (!(other instanceof Binary o)) {
53-
return false;
52+
if (other instanceof Binary o) {
53+
if (this.value == null) {
54+
return o.value == null;
55+
}
56+
return Arrays.equals(this.value, o.value);
5457
}
55-
56-
if (!o.getClass().equals(this.getClass())) {
57-
return false;
58-
}
59-
60-
if (this.value == null) {
61-
return o.value == null;
62-
}
63-
64-
return Arrays.equals(this.value, o.value);
58+
return false;
6559
}
6660

6761
public static class LargeBinary extends Binary {

Diff for: lib/src/main/java/io/cloudquery/scalar/UUID.java

+11
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ public void setValue(Object value) throws ValidationException {
4949
throw new ValidationException(ValidationException.NO_CONVERSION_AVAILABLE, this.dataType(), value);
5050
}
5151

52+
@Override
53+
public final boolean equals(Object other) {
54+
if (other instanceof UUID o) {
55+
if (this.value == null) {
56+
return o.value == null;
57+
}
58+
return this.value.equals(o.value);
59+
}
60+
return false;
61+
}
62+
5263
@Override
5364
public final int hashCode() {
5465
return Objects.hash(value);

0 commit comments

Comments
 (0)