8273308: PatternMatchTest.java fails on CI

Reviewed-by: dfuchs, smarks
This commit is contained in:
Ian Graves 2021-09-07 18:54:25 +00:00 committed by Henry Jen
parent 25c8584879
commit 4b9303b77b

View file

@ -3445,7 +3445,7 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
int length = seq.length();
int x = index;
if (lengthInCodePoints >= 0) {
assert (index >= 0 && index < length);
assert ((length == 0 && index == 0) || index >= 0 && index < length);
for (int i = 0; x < length && i < lengthInCodePoints; i++) {
if (Character.isHighSurrogate(seq.charAt(x++))) {
if (x < length && Character.isLowSurrogate(seq.charAt(x))) {