[jdk8u-dev] RFR: 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.

Bernd duke at openjdk.org
Tue Aug 23 22:10:34 UTC 2022


On Fri, 22 Jul 2022 22:13:07 GMT, Elliott Baron <ebaron at openjdk.org> wrote:

> This backport is part of the effort to update Xerces in 8u to 2.12 ([JDK-8238164](https://bugs.openjdk.org/browse/JDK-8238164).
> 
> The JDK 9 commit does not apply cleanly, but only required cosmetic changes. These are due to differences in some copyright headers, and not having a `@version` Javadoc tag in the 8u version of these files.
> 
> I am concerned over deprecating the Xerces serializer. As noted in [JDK-8219692](https://bugs.openjdk.org/browse/JDK-8219692), there are behavioural changes caused by this new serializer.

There are no additional tests needed?
BTW if the existing Testcases do not detect changed behavior then it’s either uncritical (or the tests are incomplete?)
I know with a backport there is not much room to make changes but should this really go into the Update tree with no additional testd, not even for the new api or the actual factories (to make sure the fallback is not used)

jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java line 389:

> 387:          */
> 388:         public LSSerializer createLSSerializer() {
> 389:             try {

Is there any advantage to loading this dynamically? The old implementation with a static constructor looks easier to follow. Since both are always in the same module also the fallback could be removed.

jaxp/src/com/sun/org/apache/xml/internal/serialize/OutputFormat.java line 64:

> 62:  * @see LineSeparator
> 63:  *
> 64:  * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation

That could be missleading, is it deprecated since java 9 or is it replaced since java 8u?

jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java line 161:

> 159:      * @return boolean - true if the encoding was recognized else false
> 160:      */
> 161:     public static boolean isRecognizedEncoding(String encoding)

Is there a testcard for this new API?

jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java line 542:

> 540:                     setIndentAmount(Integer.parseInt(val));
> 541:                 } else if (OutputKeys.INDENT.equals(name)) {
> 542:                     boolean b = val.endsWith("yes") ? true : false;

EndsWith is not very idiomatic for a boolean, maybe that requires an explaining comment?

-------------

PR: https://git.openjdk.org/jdk8u-dev/pull/89


More information about the jdk8u-dev mailing list