Skip to content

Commit

Permalink
Automatic merge of jdk:master into master
Browse files Browse the repository at this point in the history
  • Loading branch information
duke committed Nov 2, 2020
2 parents 8c419f7 + 6dac8d2 commit 4f6a603
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4590,13 +4590,13 @@ public static void reorderVisually(byte[] levels,
}
if (0 > objectStart || objects.length <= objectStart) {
throw new IllegalArgumentException("Value objectStart " +
levelStart + " is out of range 0 to " +
objectStart + " is out of range 0 to " +
(objects.length-1));
}
if (0 > count || objects.length < (objectStart+count)) {
throw new IllegalArgumentException("Value count " +
levelStart + " is out of range 0 to " +
(objects.length - objectStart));
count + " is less than zero, or objectStart + count" +
" is beyond objects length " + objects.length);
}

byte[] reorderLevels = new byte[count];
Expand Down
32 changes: 32 additions & 0 deletions test/jdk/java/text/Bidi/BidiConformance.java
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,11 @@ private void testMethod_reorderVisually2() {
"when levelStart is -1.");
}
catch (IllegalArgumentException e) {
if (!e.getMessage().equals(
"Value levelStart -1 is out of range 0 to " + (llen - 1))) {
errorHandling("reorderVisually() should throw an IAE" +
" mentioning levelStart is beyond the levels range. Message: " + e.getMessage());
}
}
catch (ArrayIndexOutOfBoundsException e) {
errorHandling("reorderVisually() should not throw an AIOoBE " +
Expand All @@ -1258,6 +1263,11 @@ private void testMethod_reorderVisually2() {
"when levelStart is 6(levels.length).");
}
catch (IllegalArgumentException e) {
if (!e.getMessage().equals(
"Value levelStart " + llen + " is out of range 0 to " + (llen - 1))) {
errorHandling("reorderVisually() should throw an IAE" +
" mentioning levelStart is beyond the levels range. Message: " + e.getMessage());
}
}
catch (ArrayIndexOutOfBoundsException e) {
errorHandling("reorderVisually() should not throw an AIOoBE " +
Expand All @@ -1278,6 +1288,11 @@ private void testMethod_reorderVisually2() {
" when objectStart is -1.");
}
catch (IllegalArgumentException e) {
if (!e.getMessage().equals(
"Value objectStart -1 is out of range 0 to " + (olen - 1))) {
errorHandling("reorderVisually() should throw an IAE" +
" mentioning objectStart is beyond the objects range. Message: " + e.getMessage());
}
}
catch (ArrayIndexOutOfBoundsException e) {
errorHandling("reorderVisually() should not throw an AIOoBE " +
Expand All @@ -1290,6 +1305,11 @@ private void testMethod_reorderVisually2() {
"when objectStart is 6(objects.length).");
}
catch (IllegalArgumentException e) {
if (!e.getMessage().equals(
"Value objectStart 6 is out of range 0 to " + (olen - 1))) {
errorHandling("reorderVisually() should throw an IAE" +
" mentioning objectStart is beyond the objects range. Message: " + e.getMessage());
}
}

try {
Expand All @@ -1298,6 +1318,12 @@ private void testMethod_reorderVisually2() {
"when count is -1.");
}
catch (IllegalArgumentException e) {
if (!e.getMessage().equals(
"Value count -1 is less than zero, or objectStart + count " +
"is beyond objects length " + olen)) {
errorHandling("reorderVisually() should throw an IAE" +
" mentioning objectStart/count is beyond the objects range. Message: " + e.getMessage());
}
}
catch (NegativeArraySizeException e) {
errorHandling("reorderVisually() should not throw an NASE " +
Expand All @@ -1310,6 +1336,12 @@ private void testMethod_reorderVisually2() {
"when count is 7(objects.length+1).");
}
catch (IllegalArgumentException e) {
if (!e.getMessage().equals(
"Value count " + (count + 1) + " is less than zero, or objectStart + count " +
"is beyond objects length " + olen)) {
errorHandling("reorderVisually() should throw an IAE" +
" mentioning objectStart/count is beyond the objects range. Message: " + e.getMessage());
}
}
catch (ArrayIndexOutOfBoundsException e) {
errorHandling("reorderVisually() should not throw an AIOoBE " +
Expand Down

0 comments on commit 4f6a603

Please sign in to comment.