-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
The JimpleUpType class is missing overridden implementations of both equals and hashCode. This results in logical errors and can cause unexpected exceptions when instances are used in collections or other contexts where proper equality and hashing behavior is required.
Since JimpleUpType wraps a delegate type, both equals and hashCode should operate based on the delegate, similar to how it's done in JimpleType.
Suggested Fix:
Copy the implementation for both methods from JimpleType as follows:
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
} else if (o != null && this.getClass() == o.getClass()) {
JimpleUpType that = (JimpleUpType)o;
return Objects.equals(this.delegate, that.delegate);
} else {
return false;
}
}
@Override
public int hashCode() {
return Objects.hash(new Object[]{this.delegate});
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels