-
Bug
-
Resolution: Fixed
-
P5
-
6
-
b22
-
generic
-
generic
-
Verified
BreakIterator.isBoundary(int offset) throws IllegalArgumentException in case when
offset is out of bounds of the text.
Please find below the sample for the issue:
----------------------------------------------------------------
String text = "hello world";
int values[] = {-100, -1, text.length() + 1, 100};
BreakIterator iter = BreakIterator.getWordInstance();
iter.setText("hello world");
for (int offset : values) {
try {
iter.isBoundary(offset);
System.out.println("not thrown for offset: " + offset);
} catch (IllegalArgumentException ex) {
}
}
----------------------------------------------------------------
offset is out of bounds of the text.
Please find below the sample for the issue:
----------------------------------------------------------------
String text = "hello world";
int values[] = {-100, -1, text.length() + 1, 100};
BreakIterator iter = BreakIterator.getWordInstance();
iter.setText("hello world");
for (int offset : values) {
try {
iter.isBoundary(offset);
System.out.println("not thrown for offset: " + offset);
} catch (IllegalArgumentException ex) {
}
}
----------------------------------------------------------------
- relates to
-
JDK-4153072 java.text.BreakIterator.isBoundary(int offset) fails when beginIndex > 0
-
- Closed
-