You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While Source.indexOf(ByteString) throws IllegalArgumentException on attempts to supply negative indices, Buffer's overload accepts them and return some results.
Expected behavior: Buffer.indexOf(ByteString(...), -1) should throw IAE.
The text was updated successfully, but these errors were encountered:
Expected behavior: Buffer.indexOf(ByteString(...), -1) should throw IAE.
If we take CharSequence.indexOf behavior as a reference, negative indices should be treated as 0.
That behavior is not the best, but the goal is providing an API that surprises as less as possible, and having similar behavior across different indexOf functions should be a step towards that goal.
While
Source.indexOf(ByteString)
throwsIllegalArgumentException
on attempts to supply negative indices,Buffer
's overload accepts them and return some results.Expected behavior:
Buffer.indexOf(ByteString(...), -1)
should throw IAE.The text was updated successfully, but these errors were encountered: