XMLOutputFactory REUSE_INSTANCE property defaults to true
Bernd Eckenfels
ecki at zusammenkunft.net
Thu Jul 14 23:07:03 UTC 2022
The XMLOutputFactoryImpl does not allow to share the writer instances:
https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.xml/share/classes/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java#L167
So this is initialized and set to false:
https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.xml/share/classes/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java#L62
However when you query the property from the PropertyManager it’s default seems to be true:
https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/PropertyManager.java#L154
Should this be aligned to Boolean.FALSE? Or maybe complete remove the shared instance code?
I also wonder is it expected to instantiate the Impl directly: there is no programmatic api way to request the default impl unless you define global config or system property (and this also required the impl class name so you can as well create a instance reflectively).
Gruss
Bernd
--
http://bernd.eckenfels.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20220714/c0e788de/attachment.htm>
More information about the core-libs-dev
mailing list