JDK-6600882 : toString(), hashCode() throw Exception
  • Type: Bug
  • Component: xml
  • Sub-Component: javax.xml.stream
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-09-04
  • Updated: 2012-04-25
  • Resolved: 2007-12-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
Other JDK 6 JDK 7
1.4.0 1.4Fixed 6u18Fixed 7Fixed
XMLOutputFactory of = XMLOutputFactory.newInstance();
        XMLStreamWriter w = of.createXMLStreamWriter(new ByteArrayOutputStream());

The above code throws the following exception when run with JDK6.

Exception in thread "main" java.lang.UnsupportedOperationException
        at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.entrySet(XMLStreamWriterImpl.java:2126)
        at java.util.AbstractMap.toString(AbstractMap.java:478)
        at java.lang.String.valueOf(String.java:2827)
        at java.io.PrintStream.println(PrintStream.java:771)
        at WhichSjsxp.main(WhichSjsxp.java:21)

EVALUATION Fixed in JAXP 1.4 on java.net. Will consider integrating into jdk6 update release.