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

Inconsistent bug description on EQ_COMPARING_CLASS_NAMES #1523

Closed
gloNelson opened this issue Apr 22, 2021 · 0 comments · Fixed by #1524
Closed

Inconsistent bug description on EQ_COMPARING_CLASS_NAMES #1523

gloNelson opened this issue Apr 22, 2021 · 0 comments · Fixed by #1524

Comments

@gloNelson
Copy link
Contributor

Hi,
I found an inconsistent bug description on EQ_COMPARING_CLASS_NAMES.

The description mentioned that “This method checks to see if two objects are the same class by checking to see if the names of their classes are equal” so one would expect SpotBugs to give a warning in the statement if(c.getClass().getName().equals(config.getClass().getName())). However, SpotBugs did not give any warning because its implementation actually checks if the compare statement is inside the equals method according to line 336 in OverridingEqualsNotSymmetrical.java

When we compare the bug description for this pattern and other related patterns, we think that the description should be
changed to “This class defines an equals method that...”

gloNelson added a commit to gloNelson/spotbugs that referenced this issue Apr 22, 2021
KengoTODA pushed a commit that referenced this issue Jul 23, 2021
…MPARING_CLASS_NAMES (#1524)

* fix issue #1523

* safely remove these lines.

* Merge and resolve conflicts

Co-authored-by: gloNelson <“[email protected]”>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant