Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix StateMachineVersion callback context spotbug issue #59

Merged
merged 1 commit into from
May 28, 2024

Conversation

hongkuntian
Copy link
Contributor

Issue #, if available:
N/A

Description of changes:
Fix spotBug issue identified in CallbackContext class for StateMachineVersion resource

EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC: equals method overrides equals in superclass and may not be symmetric

This class defines an equals method that overrides an equals method in a superclass. Both equals methods methods use instanceof in the determination of whether two objects are equal. This is fraught with peril, since it is important that the equals method is symmetrical (in other words, a.equals(b) == b.equals(a)). If B is a subtype of A, and A's equals method checks that the argument is an instanceof A, and B's equals method checks that the argument is an instanceof B, it is quite likely that the equivalence relation defined by these methods is not symmetric.

Culprit is that the super class implements both equals and hashCode

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@hongkuntian hongkuntian merged commit 3df87f8 into main May 28, 2024
1 check passed
@hongkuntian hongkuntian deleted the spotbugs-statemachineversion-callbackcontext branch May 28, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants