Dmitry Katsubo
2010-03-23 10:52:14 UTC
Dear XOM developers!
First of all, thank you for your contribution into XOM development. It
looks nice, and in general I like this library.
Builder.build() is passed a null InputStream, I've got the exception,
which is difficult to understand, because xerces (in case InputStream is
null) tries to discover all other ways to load the resource:
java.net.MalformedURLException
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDocumentEntity(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.setInputSource(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(Unknown Source)
at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(Unknown Source)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source)
at nu.xom.Builder.build(Builder.java:1127)
at nu.xom.Builder.build(Builder.java:586)
I think, to avoid such cases, null-pointer checks should be added to
Builder method implementations. Then the error can be reported at early
stage just by throwing NullPointerException.
First of all, thank you for your contribution into XOM development. It
looks nice, and in general I like this library.
Builder.build() is passed a null InputStream, I've got the exception,
which is difficult to understand, because xerces (in case InputStream is
null) tries to discover all other ways to load the resource:
java.net.MalformedURLException
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDocumentEntity(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.setInputSource(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(Unknown Source)
at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(Unknown Source)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source)
at nu.xom.Builder.build(Builder.java:1127)
at nu.xom.Builder.build(Builder.java:586)
I think, to avoid such cases, null-pointer checks should be added to
Builder method implementations. Then the error can be reported at early
stage just by throwing NullPointerException.
--
With best regards,
Dmitry
With best regards,
Dmitry