Skip to content

Commit 4f6a603

Browse files
author
duke
committed
Automatic merge of jdk:master into master
2 parents 8c419f7 + 6dac8d2 commit 4f6a603

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

src/java.base/share/classes/jdk/internal/icu/text/BidiBase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4590,13 +4590,13 @@ public static void reorderVisually(byte[] levels,
45904590
}
45914591
if (0 > objectStart || objects.length <= objectStart) {
45924592
throw new IllegalArgumentException("Value objectStart " +
4593-
levelStart + " is out of range 0 to " +
4593+
objectStart + " is out of range 0 to " +
45944594
(objects.length-1));
45954595
}
45964596
if (0 > count || objects.length < (objectStart+count)) {
45974597
throw new IllegalArgumentException("Value count " +
4598-
levelStart + " is out of range 0 to " +
4599-
(objects.length - objectStart));
4598+
count + " is less than zero, or objectStart + count" +
4599+
" is beyond objects length " + objects.length);
46004600
}
46014601

46024602
byte[] reorderLevels = new byte[count];

test/jdk/java/text/Bidi/BidiConformance.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,11 @@ private void testMethod_reorderVisually2() {
12461246
"when levelStart is -1.");
12471247
}
12481248
catch (IllegalArgumentException e) {
1249+
if (!e.getMessage().equals(
1250+
"Value levelStart -1 is out of range 0 to " + (llen - 1))) {
1251+
errorHandling("reorderVisually() should throw an IAE" +
1252+
" mentioning levelStart is beyond the levels range. Message: " + e.getMessage());
1253+
}
12491254
}
12501255
catch (ArrayIndexOutOfBoundsException e) {
12511256
errorHandling("reorderVisually() should not throw an AIOoBE " +
@@ -1258,6 +1263,11 @@ private void testMethod_reorderVisually2() {
12581263
"when levelStart is 6(levels.length).");
12591264
}
12601265
catch (IllegalArgumentException e) {
1266+
if (!e.getMessage().equals(
1267+
"Value levelStart " + llen + " is out of range 0 to " + (llen - 1))) {
1268+
errorHandling("reorderVisually() should throw an IAE" +
1269+
" mentioning levelStart is beyond the levels range. Message: " + e.getMessage());
1270+
}
12611271
}
12621272
catch (ArrayIndexOutOfBoundsException e) {
12631273
errorHandling("reorderVisually() should not throw an AIOoBE " +
@@ -1278,6 +1288,11 @@ private void testMethod_reorderVisually2() {
12781288
" when objectStart is -1.");
12791289
}
12801290
catch (IllegalArgumentException e) {
1291+
if (!e.getMessage().equals(
1292+
"Value objectStart -1 is out of range 0 to " + (olen - 1))) {
1293+
errorHandling("reorderVisually() should throw an IAE" +
1294+
" mentioning objectStart is beyond the objects range. Message: " + e.getMessage());
1295+
}
12811296
}
12821297
catch (ArrayIndexOutOfBoundsException e) {
12831298
errorHandling("reorderVisually() should not throw an AIOoBE " +
@@ -1290,6 +1305,11 @@ private void testMethod_reorderVisually2() {
12901305
"when objectStart is 6(objects.length).");
12911306
}
12921307
catch (IllegalArgumentException e) {
1308+
if (!e.getMessage().equals(
1309+
"Value objectStart 6 is out of range 0 to " + (olen - 1))) {
1310+
errorHandling("reorderVisually() should throw an IAE" +
1311+
" mentioning objectStart is beyond the objects range. Message: " + e.getMessage());
1312+
}
12931313
}
12941314

12951315
try {
@@ -1298,6 +1318,12 @@ private void testMethod_reorderVisually2() {
12981318
"when count is -1.");
12991319
}
13001320
catch (IllegalArgumentException e) {
1321+
if (!e.getMessage().equals(
1322+
"Value count -1 is less than zero, or objectStart + count " +
1323+
"is beyond objects length " + olen)) {
1324+
errorHandling("reorderVisually() should throw an IAE" +
1325+
" mentioning objectStart/count is beyond the objects range. Message: " + e.getMessage());
1326+
}
13011327
}
13021328
catch (NegativeArraySizeException e) {
13031329
errorHandling("reorderVisually() should not throw an NASE " +
@@ -1310,6 +1336,12 @@ private void testMethod_reorderVisually2() {
13101336
"when count is 7(objects.length+1).");
13111337
}
13121338
catch (IllegalArgumentException e) {
1339+
if (!e.getMessage().equals(
1340+
"Value count " + (count + 1) + " is less than zero, or objectStart + count " +
1341+
"is beyond objects length " + olen)) {
1342+
errorHandling("reorderVisually() should throw an IAE" +
1343+
" mentioning objectStart/count is beyond the objects range. Message: " + e.getMessage());
1344+
}
13131345
}
13141346
catch (ArrayIndexOutOfBoundsException e) {
13151347
errorHandling("reorderVisually() should not throw an AIOoBE " +

0 commit comments

Comments
 (0)