8297856: Improve handling of Bidi characters

Reviewed-by: rhalade, mschoene, rriggs
This commit is contained in:
Naoto Sato 2022-12-13 00:15:20 +00:00 committed by Henry Jen
parent 072d64c6a9
commit 195c9b2c48

View File

@ -4595,7 +4595,7 @@ public class BidiBase {
objectStart + " is out of range 0 to " +
(objects.length-1));
}
if (0 > count || objects.length < (objectStart+count)) {
if (0 > count || objects.length - count < objectStart) {
throw new IllegalArgumentException("Value count " +
count + " is less than zero, or objectStart + count" +
" is beyond objects length " + objects.length);