Skip to content

Commit

Permalink
ReferenceBindingSetWrapper: use System.identityHashCode
Browse files Browse the repository at this point in the history
Its just an IdentityWrapper - do not rely on ReferenceBinding
implementation.

relates to
#3452
  • Loading branch information
EcljpseB0T authored and jukzi committed Dec 17, 2024
1 parent e69701a commit 5e40502
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1210,10 +1210,6 @@ public int hashCode() {
: CharOperation.hashCode(this.compoundName[this.compoundName.length - 1]);
}

final int identityHashCode() {
return super.hashCode();
}

/**
* Returns true if the two types have an incompatible common supertype,
* e.g. {@code List<String>} and {@code List<Integer>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@ final class ReferenceBindingSetWrapper {

ReferenceBindingSetWrapper(ReferenceBinding referenceBinding) {
this.referenceBinding = referenceBinding;
this.hashCode = referenceBinding.identityHashCode();
this.hashCode = System.identityHashCode(referenceBinding);
}

@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof ReferenceBindingSetWrapper) {
ReferenceBindingSetWrapper other = (ReferenceBindingSetWrapper) obj;
if (obj instanceof ReferenceBindingSetWrapper other) {
return identityEqual(this.referenceBinding, other.referenceBinding);
}
return false;
Expand Down

0 comments on commit 5e40502

Please sign in to comment.