On 24/03/2016 14:29, David M. Lloyd wrote:

Daniel, I have hacked together a way to use the system class loader (which should be "good enough", I hope), but there is one further problem: org.xml.sax.helpers.XMLReaderFactory does not have a factory method which accepts a class loader like the others do. Any thoughts on this one? It looks like it might be pretty easy to add this method... but then, it's also pretty easy to just add setters to set the default Class :)


I hope we can avoid introducing an API to change the global/default implementation mid-flight. It would be attractive nuisance. It it almost always wrong to have a static in a system class with a strong reference to something that is transient. There are often security and memory retention issues. This becomes a lot more obvious when you have multiple applications running in the same VM.

On org.xml.sax.helpers.XMLReaderFactory then this is endorsed API. As it happens, it came under the spot light in a recent thread because it has not been converted to use ServiceLoader. I believe Joe Wang is seeing if this can be progressed in the upstream SAX project.

-Alan

Reply via email to