Under some JDK's (notably both Sun and IBM 1.4.0), getClassLoader(), when invoked
on the JAXP or SAX classes, it returns null. This means that
the fallback mechanism in these APIs may not work correctly: in
particular, when an attempt to invoke an unknown Parser/XMLReader
implementation is made in SAX, a NullPointerException rather than the correct
ClassNotFoundException results. This patch fixes this problem,
by using Class.forName() in the event that the bootstrap
classloader is not returned in this particular situation.
git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@226239 13f79535-47bb-0310-9956-ffa450edef68
The reader used to read the service provider is never
closed if an IOException is thrown while reading from
it. Adding a finally block so that the reader will
always be closed.
git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@226238 13f79535-47bb-0310-9956-ffa450edef68
When reading the service provider name from a jar
a BufferedReader is used to read the first line from the
file. BufferedReader's default buffer size is 8K chars. Since
we're only reading one line (the name of a class) this is pretty
excessive. Reducing this size significantly to 80 chars.
git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@226237 13f79535-47bb-0310-9956-ffa450edef68
from this branch to pass the JAXP 1.2 TCK. I've attempted to keep
these as limited as possible, in a few cases simply
modifying the original commons source directly rather than simply
importing Xerces code. However, for many changes--such as that
involving correct handling of security-critical operations
like property checking--I've simply imported the relevant Xerces code.
I have always indicated in the comments at the top of substituted
files that they are substitutions (except in the case of the JAXP code
in which virtually all files were touched); where I've modified commons
code directly, I've placed comments immediately above
the modifications.
git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@226021 13f79535-47bb-0310-9956-ffa450edef68