We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given a, b, and c are all non-negative integers, and b < c, then we can conclude that a + b < a + c.
Consider the following example from Guava:
public List<Short> subList( @IndexOrHigh("this") @LessThan("#2") int fromIndex, @IndexOrHigh("this") int toIndex) { int size = size(); checkPositionIndexes(fromIndex, toIndex, size); if (fromIndex == toIndex) { return Collections.emptyList(); } return new ShortArrayAsList(array, start + fromIndex, start + toIndex); }
The constructor call on the last line requires the second parameter to be less than the third.
The text was updated successfully, but these errors were encountered:
I don't think it matters if a, b, or c are non-negative. If b < c then a + b < a + c.
b < c
a + b < a + c
Sorry, something went wrong.
Modulo overflow, of course.
You're both right. I think it's worth implementing anyway - the Index Checker is already unsound wrt overflow.
No branches or pull requests
Given a, b, and c are all
non-negativeintegers, and b < c, then we can conclude that a + b < a + c.Consider the following example from Guava:
The constructor call on the last line requires the second parameter to be less than the third.
The text was updated successfully, but these errors were encountered: