-
Notifications
You must be signed in to change notification settings - Fork 360
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
Message improvement request: contracts.conditional.postcondition contract is unclear #3619
Comments
I agree that error message is quite confusing and should be improved. Thank you for reporting it. #3621 will change the message to:
Let me know whether that is clear enough, or if you have suggestions for further improving it. |
By the way, your implementation of @Override
public boolean equals(@Nullable Object obj) {
return this == obj
|| (obj instanceof ImmutableIntList
? Arrays.equals(ints, ((ImmutableIntList) obj).ints)
: obj instanceof List && obj.equals(this));
} or @Override
public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
}
return obj instanceof ImmutableIntList
? Arrays.equals(ints, ((ImmutableIntList) obj).ints)
: obj instanceof List
&& obj.equals(this);
} |
I have opened a new issue, #3622, to track the fact that the warning is a false positive. |
Oh, you are right this can be improved. I was focused more on annotating nullness, and I did not want to break code by accident :)
Wow! It would be much better. |
Error message:
Sample code (see https://github.com/apache/calcite/blob/103430bcc76ed1a7cbab6861ecdd39814cf4ef83/core/src/main/java/org/apache/calcite/util/ImmutableIntList.java#L115-L121 ):
Error message:
Unfortunately, it is hard to tell what went wrong.
What if checker-framework printed the contract in question, so users could figure out what went wrong.
PS. I think the error is false-positive
The text was updated successfully, but these errors were encountered: