8297856: Improve handling of Bidi characters

Reviewed-by: mbalao, andrew
Backport-of: 244b89fc786894cb8cca742f91875ebb98b603ff
This commit is contained in:
Alexei Voitylov 2023-09-01 21:51:00 +00:00 committed by Andrew John Hughes
parent 9d59e5b0a9
commit dc7013e0d9

View File

@ -3391,7 +3391,7 @@ public class BidiBase {
levelStart + " 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 " +
levelStart + " is out of range 0 to " +
(objects.length - objectStart));