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
minor: do not check details if checker suppression is unstable #12211
Conversation
7d12f2e
to
f631e97
Compare
Unfortunately, this will not work, we got a new changing variable:
|
f631e97
to
5e6e173
Compare
b5280cb
to
a71a029
Compare
.ci/checker-framework.groovy
Outdated
result = (fileName != null ? fileName.hashCode() : 0) | ||
result = 31 * result + (specifier != null ? specifier.hashCode() : 0) | ||
result = 31 * result + (message != null ? message.hashCode() : 0) | ||
result = 31 * result + (details != null ? details.hashCode() : 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work if hashCode
is actually required and used.
If two objects are equal according to equals() method, then their hash code must be same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as you override hashCode
and don't implement similar logic between it and equals, it will be an issue. Removing details and message from just this method won't "Fix" the underlying issue.
Is this hashCode actually used/needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I just figured codenarc or something else would have a warning about overriding equals but not hashcode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed it, let's see if there are any warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another question, do we actually have a reason for it to be equals
or can it be it's own thing like fuzzyEquals
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/checkstyle/checkstyle/blob/master/.ci/checker-framework.groovy#L163
final Set<CheckerFrameworkError> errors = new HashSet<>()
It is a hash object. You will need a valid hashCode
and equals
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another question, do we actually have a reason for it to be
equals
or can it be it's own thing likefuzzyEquals
?
Set.contains relies on equals.
2428c4e
to
aaf78cf
Compare
aaf78cf
to
c0bb9d2
Compare
we can not ignore message, better to apply regexp to it to remove variable part. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
items:
Closing in favor of #12215 |
This is a quick hack until we come up with better idea for #12210