mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8255242: Bidi.requiresBidi has misleading exception message
Reviewed-by: bchristi
This commit is contained in:
parent
60d014242b
commit
57d903bdd9
2 changed files with 10 additions and 3 deletions
|
@ -4541,7 +4541,8 @@ public class BidiBase {
|
||||||
|
|
||||||
if (0 > start || start > limit || limit > text.length) {
|
if (0 > start || start > limit || limit > text.length) {
|
||||||
throw new IllegalArgumentException("Value start " + start +
|
throw new IllegalArgumentException("Value start " + start +
|
||||||
" is out of range 0 to " + limit);
|
" is out of range 0 to " + limit + ", or limit " + limit +
|
||||||
|
" is beyond the text length " + text.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = start; i < limit; ++i) {
|
for (int i = start; i < limit; ++i) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @bug 6850113 8032446
|
* @bug 6850113 8032446 8255242
|
||||||
* @summary confirm the behavior of new Bidi implementation. (Backward compatibility)
|
* @summary confirm the behavior of new Bidi implementation. (Backward compatibility)
|
||||||
* @modules java.desktop
|
* @modules java.desktop
|
||||||
*/
|
*/
|
||||||
|
@ -1397,6 +1397,12 @@ public class BidiConformance {
|
||||||
" when limit is textLength+1(too large).");
|
" when limit is textLength+1(too large).");
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException e) {
|
catch (IllegalArgumentException e) {
|
||||||
|
if (!e.getMessage().equals(
|
||||||
|
"Value start 0 is out of range 0 to " + (textLength + 1) +
|
||||||
|
", or limit " + (textLength + 1) + " is beyond the text length " + textLength)) {
|
||||||
|
errorHandling("requiresBidi() should throw an IAE" +
|
||||||
|
" mentioning limit is beyond the text length. Message: " + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (ArrayIndexOutOfBoundsException e) {
|
catch (ArrayIndexOutOfBoundsException e) {
|
||||||
errorHandling("requiresBidi() should not throw an AIOoBE " +
|
errorHandling("requiresBidi() should not throw an AIOoBE " +
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue