-
Bug
-
Resolution: Fixed
-
P3
-
1.1.6
-
1.1.8
-
sparc
-
solaris_2.5
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2018520 | 1.2.0 | Laura Werner | P3 | Closed | Fixed | 1.2beta4 |
Name: dfC67450 Date: 01/06/98
The java.text.CollationElementIterator.reset() method does not work correctly.
This method throws NullPointerException when string under iteration is empty.
Here is the test demonstrating the bug:
-----------------TestA.java------------------------
import java.text.*;
public class TestA {
public static void main (String args[]){
RuleBasedCollator rbc = null;
try {
rbc = new RuleBasedCollator("< a < b");
} catch (ParseException e) {
System.out.println("Unexpected ParseException: "+e);
}
CollationElementIterator iterator =
rbc.getCollationElementIterator("");
iterator.reset();
if (iterator.next() == iterator.NULLORDER) System.out.println("Ok");
}
}
---------Output from the test in JDK1.1.6---------------------
java.lang.NullPointerException
at java.text.CollationElementIterator.reset(CollationElementIterator.java:125)
at TestA.main(TestA.java:13)
---------Output from the test in JDK1.1.5---------------------
Ok
--------------------------------------------------------------
======================================================================
- backported by
-
JDK-2018520 java.text.CollationElementIterator.reset() throws NullPointerException
- Closed