-
CSR
-
Resolution: Approved
-
P4
-
None
-
minimal
-
There is no compatibility risk. This change removes only an incorrect statement.
-
Java API
-
SE
Summary
Clarifies that XMLStreamReader.next() throws NoSuchElementException when hasNext() is false
Problem
XMLStreamReader.next() specified in the throw statement that NoSuchElementException should be thrown when hasNext() returns false . However, it also contained an unnecessary statement in a note of the general specification that IllegalStateException will be thrown in the situation.
Solution
Remove the statement that stated IllegalStateException will be thrown.
Specification
javax.xml.stream.XMLStreamReader
NOTE: empty element (such as <tag/>) will be reported with two separate events: START_ELEMENT,
- END_ELEMENT - This preserves parsing equivalency of empty element to <tag></tag>. This method
- will throw an IllegalStateException if it is called after hasNext() returns false.
+ END_ELEMENT - This preserves parsing equivalency of empty element to <tag></tag>.
- csr of
-
JDK-8204329 Java API doc for XMLStreamReader.next() needs to be clarified for the exception thrown when hasNext() method returns false
- Closed