Skip to content

Commit d98674b

Browse files
committed
removed .equals on DeferredExecution
1 parent 33c20ae commit d98674b

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/main/java/graphql/execution/incremental/DeferredExecution.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import graphql.normalized.incremental.NormalizedDeferredExecution;
55
import org.jspecify.annotations.Nullable;
66

7-
import java.util.Objects;
8-
97
/**
108
* Represents details about the defer execution that can be associated with a {@link graphql.execution.MergedField}.
119
* <p>
@@ -25,17 +23,17 @@ public String getLabel() {
2523
return label;
2624
}
2725

26+
// this class uses object identity - do not put .equals() / .hashCode() implementations on it
27+
// otherwise it will break defer handling. I have put the code just to be explicit that object identity
28+
// is needed
29+
2830
@Override
29-
public boolean equals(Object o) {
30-
if (o == null || getClass() != o.getClass()) {
31-
return false;
32-
}
33-
DeferredExecution that = (DeferredExecution) o;
34-
return Objects.equals(label, that.label);
31+
public int hashCode() {
32+
return super.hashCode();
3533
}
3634

3735
@Override
38-
public int hashCode() {
39-
return Objects.hashCode(label);
36+
public boolean equals(Object obj) {
37+
return super.equals(obj);
4038
}
4139
}

0 commit comments

Comments
 (0)