-
Bug
-
Resolution: Fixed
-
P4
-
7
-
1.4
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2207330 | 7 | Joe Wang | P4 | Closed | Fixed | b112 |
JAXP SAXParserFactory has the setXIncludeAware method that reads like this:
> > public void setXIncludeAware(final boolean state) {
> > throw new UnsupportedOperationException(
> > "This parser does not support specification \""
> > + this.getClass().getPackage().getSpecificationTitle()
> > + "\" version \""
> > + this.getClass().getPackage().getSpecificationVersion()
> > + "\""
> > );
> > }
This most typically just results in the following error, which is not
useful at all:
> > Caused by: java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
> > at javax.xml.parsers.SAXParserFactory.setXIncludeAware(SAXParserFactory.java:448)
> > at org.jclouds.http.functions.config.ParserModule.provideSAXParserFactory(ParserModule.java:124)
> > ... 146 more
> >
I find this getPackage()... business pointless. It's much better if the
code is just
throw new UnsupportedOperationException("setXIncludeAware is not
supported on this JAXP 1.4 implementation or earlier: "+this.getClass());
An extra bonus point is to let the method work silently if the state is
false, since it's a no-op.
-- Kohsuke Kawaguchi http://weblogs.java.net/blog/kohsuke/
> > public void setXIncludeAware(final boolean state) {
> > throw new UnsupportedOperationException(
> > "This parser does not support specification \""
> > + this.getClass().getPackage().getSpecificationTitle()
> > + "\" version \""
> > + this.getClass().getPackage().getSpecificationVersion()
> > + "\""
> > );
> > }
This most typically just results in the following error, which is not
useful at all:
> > Caused by: java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
> > at javax.xml.parsers.SAXParserFactory.setXIncludeAware(SAXParserFactory.java:448)
> > at org.jclouds.http.functions.config.ParserModule.provideSAXParserFactory(ParserModule.java:124)
> > ... 146 more
> >
I find this getPackage()... business pointless. It's much better if the
code is just
throw new UnsupportedOperationException("setXIncludeAware is not
supported on this JAXP 1.4 implementation or earlier: "+this.getClass());
An extra bonus point is to let the method work silently if the state is
false, since it's a no-op.
-- Kohsuke Kawaguchi http://weblogs.java.net/blog/kohsuke/
- backported by
-
JDK-2207330 The setXIncludeAware method in SAXParserFactory throws obscure error message
- Closed