[8u] RFR: 8238164: Update Apache Xerces to version 2.12.0
Elliott Baron
ebaron at redhat.com
Mon Jul 19 21:35:54 UTC 2021
Hi,
I'd like to request a review of 8238164 for 8u for parity with Oracle
JDK 8u261.
8238164 is an 8-only bug, but has an extensive "relates to" list that I
used as a guide for what to backport. I had considered copying over
Xerces 2.12.0 en masse from JDK 11, but many of the related changes in
8238164 extend beyond the Xerces package (e.g. Xalan, XML).
The chief concern I have with this backport is the lack of unit tests in
the JAXP repo in 8u. Some of the referenced fixes below include new
tests or changes to tests that were added in JDK 9 beginning with
"8043084: XML JAXP unittest co-location".
I'd also like to note that there are minor changes to
javax/xml/stream/XMLEventReader and javax/xml/stream/XMLStreamReader.
The former adds an @Override tag, the other changes are all to
documentation. I'm not sure if the override tag poses a problem to API
compatibility.
One other minor issue is the @deprecated tag added to Xerces' internal
serializer. This is not public API, but I was unsure whether to change
the version from JDK 1.9 to JDK 1.8. I've just left it alone in this
initial webrev. See:
com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java.
The end of this mail contains a detailed list of related fixes mentioned
in 8238164 that are included in this webrev, along with what
modifications I made for them to apply to the 8u tree. The list also
covers which of related fixes are not included in this webrev, and why not.
Bug: https://bugs.openjdk.java.net/browse/JDK-8238164
Webrev: https://cr.openjdk.java.net/~ebaron/jdk8u/JDK-8238164/webrev.00/
Testing: x86_64 build, jdk_tier1, jdk_other (includes javax/xml) tests
Thanks,
Elliott
---
Detailed list of included backported fixes:
8033980: Xerces Update: datatype XMLGregorianCalendarImpl and DurationImpl:
- One hunk already fixed by "8028363:
XmlGregorianCalendarImpl.getTimeZone() bug when offset is less than 10
minutes".
8035469: Xerces Update: EncodingMap does not recognize Java-style
encodings Cp1141-Cp1149:
- Already fixed by "8068842: Better JAXP data handling".
8035577: Xerces Update: impl/xpath/regex/RangeToken.java:
- Applies cleanly.
8035437: Xerces Update: xml/serialize/DOMSerializerImpl
- com/sun/org/apache/xerces/internal/impl/XMLEntityManager
-- Copyright header differences
-- Import differences
- com/sun/org/apache/xml/internal/serialize/XMLSerializer
-- Copyright header differences
-- Import differences
-- Changed context due to previous backport of "8068842: Better JAXP
data handling".
- com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer
-- Copyright header differences
-- Import differences
- com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl
-- Context changes due to "8146961: Fix PermGen memory leaks caused by
static final Exceptions" and "8011795: DOM Serializer prints stack
traces to System.err"
8037259: xerces update: xpointer update
- Applies cleanly.
8041523: Xerces Update: Serializer improvements from Xalan
- com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet
-- Copyright header differences
-- Import differences
- com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl
-- Copyright header differences
-- Import differences
- com/sun/org/apache/xml/internal/serializer/EmptySerializer
-- Copyright header differences
-- Import differences
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate
Xerces' native serializer.
- com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl
-- @version tag in 8u context
- com/sun/org/apache/xml/internal/serialize/ElementState
-- Copyright header differences
- com/sun/org/apache/xml/internal/serialize/EncodingInfo
-- @version tag in 8u context
- com/sun/org/apache/xml/internal/serialize/Encodings
-- Copyright header differences
- com/sun/org/apache/xml/internal/serialize/HTMLdtd
-- Copyright header differences
- com/sun/org/apache/xml/internal/serialize/SerializerFactory
-- Copyright header differences
8053965: Xerces update breaks profile build
- Applies cleanly.
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
- com/sun/org/apache/xerces/internal/impl/Constants
-- Copyright header differences
- com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator
-- Copyright header differences
-- Context change due to "8186080: Transform XML interfaces"
- com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory
-- Copyright header differences
-- Context change due to "8186080: Transform XML interfaces"
- com/sun/org/apache/xerces/internal/parsers/XML11Configuration
-- Copyright header differences
-- Indentation differences due to "8149915: enabling
validate-annotations feature for xsd schema with annotation causes NPE"
-- One line context difference due to "8186080: Transform XML interfaces"
8056202: Xerces Update: Catalog Resolver
- com/sun/org/apache/xml/internal/resolver/Catalog
-- Copyright header differences
-- Imports differ due to "8068842: Better JAXP data handling"
-- Affected code in one hunk removed by "8078427: More supportive home
environment"
- com/sun/org/apache/xml/internal/resolver/CatalogEntry
-- Copyright header differences
-- Fields to patch changed by "8068842: Better JAXP data handling"
- com/sun/org/apache/xml/internal/resolver/CatalogManager
-- Patch context differs slightly due to "8186080: Transform XML interfaces"
- com/sun/org/apache/xml/internal/resolver/helpers/BootstrapResolver
-- Copyright header differences
-- Some fields already made final by "8068842: Better JAXP data handling"
- com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader
-- Copyright header differences
- com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogReader
-- Copyright header differences
-- "8068842: Better JAXP data handling" changes a field from Hashtable
to Map
- com/sun/org/apache/xml/internal/resolver/tools/ResolvingParser
-- Context differs due to "8186080: Transform XML interfaces"
8036951: Xerces Update: XMLSchemaValidator.java and XMLSchemaLoader.java
- com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl
-- Copyright header differences
-- Import differences from "8186080: Transform XML interfaces"
- com/sun/org/apache/xerces/internal/impl/XMLEntityManager
-- Import differences from "8068842: Better JAXP data handling"
-- Some changes already present from backport of "8039533: Higher
resolution resolvers"
- com/sun/org/apache/xerces/internal/impl/XMLErrorReporter
-- Copyright header differences
- com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader
-- Copyright header differences
-- Context differs due to "8068842: Better JAXP data handling"
- com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator
-- Import differences from "8068842: Better JAXP data handling"
-- Context differences "8186080: Transform XML interfaces"
-- Some changes superseded by "8068842: Better JAXP data handling"
- com/sun/org/apache/xerces/internal/util/XMLAttributesImpl
-- Copyright header differences
8080906: Develop test for Xerces Update: DOM L3 Serializer
- Skipped. No tests in 8u jaxp repo. Do we backport them?
8080908: Develop test for Xerces Update: XPointer
- Skipped. No tests in 8u jaxp repo
8080907: Develop test for Xerces Update: XML Schema Validation
- Skipped. No tests in 8u jaxp repo
8080266: Failed to create CharInfo due to ResourceBundle update for modules
- test/javax/xml/jaxp/unittest/org/w3c/dom/ls/LSSerializerTest
-- No tests in 8u jaxp repo
8142900: Xerces Update: Xerces XPath
- com/sun/org/apache/xerces/internal/impl/xpath/regex/Token
-- Context differs due to lambda usage in "8068842: Better JAXP data
handling"
8142463: Xml schema validation failing after Xerces update; maxOccurs
ignored
- test/javax/xml/jaxp/unittest/validation/tck
-- Directory not included in backport, no tests in 8u
8167002: JAXP schema validator: Use HashSet instead of ArrayList for
tracking XML IDs
- Applies cleanly
8069098: StAX produces the wrong event stream (Dep for 8169450)
- test/javax/xml/jaxp/unittest/stream/XMLStreamReaderTest/BugTest
-- No tests in 8u jaxp repo
8169450: StAX parse error if there is a newline in xml declaration
- com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl
-- Different field name because "8170556: Warnings cleanup related to
JDK-8167340" not in 8u.
- test/javax/xml/jaxp/unittest/parsers/BaseParsingTest
-- No tests in 8u jaxp repo
8150256: removing xerces-related dead code
- com/sun/org/apache/xerces/internal/xinclude/XPointerElementHandler
- com/sun/org/apache/xerces/internal/xinclude/XPointerFramework
-- Didn't apply cleanly, but files are deleted
8181150: Fix lint warnings in JAXP repo: rawtypes and unchecked
- Didn't backport. Too big.
8038043: Xerces Update: XInclude update
- com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl
-- Copyright header differences.
- com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser
-- Copyright header differences.
- com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler
-- Copyright header differences.
-- Import order different, and Stack fields not parameterized, because
"8181150: Fix lint warnings in JAXP repo: rawtypes and unchecked" not
backported.
-- ObjectFactory import retained because "8166398: CatalogSupport tests
need to be fixed" not in 8u, which removed its usage in this class.
- com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader
-- Copyright header differences.
- test/javax/xml/jaxp/unittest/common/EncodingErrorsReportingTest
- test/javax/xml/jaxp/unittest/parsers/BaseParsingTest
-- No tests in 8u jaxp repo
8213117: adoptNode corrupts attribute values
- com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl
-- No @LastModified tag to modify, introduced in "8193568: @LastModified
tag in license header".
- test/javax/xml/jaxp/unittest/dom/DocumentTest
-- No tests in 8u jaxp repo
8222415: Xerces 2.12.0: Parsing Configuration
- com/sun/org/apache/xerces/internal/impl/XMLEntityManager
-- Copyright header differences.
-- No @LastModified tag to modify, introduced in "8193568: @LastModified
tag in license header".
-- Context differs due to no backport of "8158084: Catalog API: JAXP XML
Processor Support".
-- Some lines differ due to no backport of "8181154: Fix lint warnings
in JAXP repo: deprecation" and "8170556: Warnings cleanup related to
JDK-8167340". End result is the same.
- test/javax/xml/jaxp/unittest/parsers/BaseParsingTest
-- No tests in 8u jaxp repo
8222743: Xerces 2.12.0: DOM Implementation
- com/sun/org/apache/xerces/internal/dom/AttrImpl
-- Copyright header differences.
-- Import differences due to no backport of "8181154: Fix lint warnings
in JAXP repo: deprecation".
-- No "ElementTraversal" condition since "8138721: ElementTraversal:
javadoc warning; also, hasFeature shall return true" is not in 8u.
-- getFeature method has extra code removed by "8042244: Re-examine the
supportedness of non-SE org.w3c.dom.** API".
-- Context for doc change differs because of no "8181154: Fix lint
warnings in JAXP repo: deprecation".
-- 2 line difference because of no "8130051: Cleanup usage of reflection
in jaxp" in 8u.
- com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl
-- Copyright header differences.
-- Import differences due to lack of "8181150: Fix lint warnings in JAXP
repo: rawtypes and unchecked" and "8158084: Catalog API: JAXP XML
Processor Support".
-- No @LastModified tag to modify, introduced in "8193568: @LastModified
tag in license header".
-- Features differ due to no "8158084: Catalog API: JAXP XML Processor
Support".
-- One line type difference from "8181150: Fix lint warnings in JAXP
repo: rawtypes and unchecked".
- com/sun/org/apache/xerces/internal/dom/DOMNormalizer
-- Copyright header differences.
-- No @LastModified tag to modify, introduced in "8193568: @LastModified
tag in license header".
-- Import order differs due to lack of "8181150: Fix lint warnings in
JAXP repo: rawtypes and unchecked".
-- Difference in 8u version of "8146961: Fix PermGen memory leaks caused
by static final Exceptions" causes a slight difference in context.
-- Removed line differs because of "8158204: accessExternalSchema
property handling is inconsistent and differs from spec." absent in 8u.
-- Method call in two places replaced with non-deprecated equivalent by
"8181154: Fix lint warnings in JAXP repo: deprecation", which is not in 8u.
- com/sun/org/apache/xerces/internal/dom/ElementImpl
-- This patch reverts some formatting changes done by "8135283: DOM API
update: Element Traversal Specification", which is not backported. These
changes are removed where applicable.
-- setOwnerDocument changed from package-private to protected, as
required by this patch. Was made protected in 11u by "8135283: DOM API
update: Element Traversal Specification", which is not backported.
- com/sun/org/apache/xerces/internal/dom/NodeImpl
-- Copyright header differences.
- com/sun/org/apache/xerces/internal/dom/ParentNode
-- Version tag still present in context because "8048021: Remove
@version tag in jaxp repo" not in 8u.
- com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings
-- Copyright header differences.
-- Version tag still present in context because "8048021: Remove
@version tag in jaxp repo" not in 8u.
-- Minor code differences due to "8158084: Catalog API: JAXP XML
Processor Support" not in 8u.
- test/javax/xml/jaxp/unittest/dom/DocumentTest
-- No tests in 8u jaxp repo
8222991: Xerces 2.12.0: Validation
- com/sun/org/apache/xerces/internal/impl/dv/xs/TypeValidator
-- Added a getSystemProperty(final String propName, final String def) to
com.sun.org.apache.xerces.internal.utils.SecuritySupport, in place of
jdk.xml.internal.SecuritySupport, because the latter is non-public in 8u.
- com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser
-- Add java.util.List import, added in 11+ by "8181150: Fix lint
warnings in JAXP repo: rawtypes and unchecked".
-
com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser
-- Copyright header differences.
-- Version tag still present in context because "8048021: Remove
@version tag in jaxp repo" not in 8u.
- com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler
-- No @LastModified tag to modify, introduced in "8193568: @LastModified
tag in license header".
-- Some raw types still used in context due to no "8181150: Fix lint
warnings in JAXP repo: rawtypes and unchecked" in 8u.
-- Converting some ArrayLists in addNewImportedGrammars where Vectors
are expected in 8u code due to lack of "8181150: Fix lint warnings in
JAXP repo: rawtypes and unchecked".
- test/javax/xml/jaxp/unittest/validation/SchemaTest
-- No tests in 8u jaxp repo
8223658: Performance regression of XML.validation in 13-b19
- com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl
-- Copyright header differences.
-- No @LastModified tag to modify, introduced in "8193568: @LastModified
tag in license header".
8225005: Xerces 2.12.0: License file
- Moved version update from src/java.xml/share/legal/xerces.md to
THIRD_PARTY_README.
More information about the jdk8u-dev
mailing list