File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
src/java.base/share/classes/jdk/internal/icu/text Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -4541,7 +4541,8 @@ public static boolean requiresBidi(char[] text,
4541
4541
4542
4542
if (0 > start || start > limit || limit > text .length ) {
4543
4543
throw new IllegalArgumentException ("Value start " + start +
4544
- " is out of range 0 to " + limit );
4544
+ " is out of range 0 to " + limit + ", or limit " + limit +
4545
+ " is beyond the text length " + text .length );
4545
4546
}
4546
4547
4547
4548
for (int i = start ; i < limit ; ++i ) {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2009, 2016 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2009, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
23
23
24
24
/*
25
25
* @test
26
- * @bug 6850113 8032446
26
+ * @bug 6850113 8032446 8255242
27
27
* @summary confirm the behavior of new Bidi implementation. (Backward compatibility)
28
28
* @modules java.desktop
29
29
*/
@@ -1397,6 +1397,12 @@ private void testMethod_requiresBidi() {
1397
1397
" when limit is textLength+1(too large)." );
1398
1398
}
1399
1399
catch (IllegalArgumentException e ) {
1400
+ if (!e .getMessage ().equals (
1401
+ "Value start 0 is out of range 0 to " + (textLength + 1 ) +
1402
+ ", or limit " + (textLength + 1 ) + " is beyond the text length " + textLength )) {
1403
+ errorHandling ("requiresBidi() should throw an IAE" +
1404
+ " mentioning limit is beyond the text length. Message: " + e .getMessage ());
1405
+ }
1400
1406
}
1401
1407
catch (ArrayIndexOutOfBoundsException e ) {
1402
1408
errorHandling ("requiresBidi() should not throw an AIOoBE " +
You can’t perform that action at this time.
0 commit comments