On Mon, 2 Mar 2026 15:29:32 GMT, Raffaello Giulietti <[email protected]>
wrote:
> A doc only change to clarify that the _smallest_ of many possible mismatch
> indices is returned.
@rgiulietti, judging from `git grep -C 3 ArraysSupport.mismatch` output,
`StringLatin1` is the only call-site using the index returned to locate an
element:
int k = ArraysSupport.mismatch(value, other, lim);
return (k < 0) ? len1 - len2 : getChar(value, k) - getChar(other, k);
Other call sites are only interested in how the index compares to 0, e.g.:
return ArraysSupport.mismatch(a, a2, length) < 0;
Does the finding of _"ArraysSupport::mismatch should return the smallest
index"_ warrant a dedicated test verifying this behavior? (I could not find
any.) Or it is sufficient to rely on the existing `String` tests?
-------------
Marked as reviewed by vyazici (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/29997#pullrequestreview-3878467945