Split XmlFactories into one Safe factory class per JAXP type (Multi-Release jar) - #54
Closed
ppkarwasz wants to merge 1 commit into
Closed
Split XmlFactories into one Safe factory class per JAXP type (Multi-Release jar)#54ppkarwasz wants to merge 1 commit into
ppkarwasz wants to merge 1 commit into
Conversation
Replace the single XmlFactories facade with SafeDocumentBuilderFactory, SafeSAXParserFactory, SafeSchemaFactory, SafeTransformerFactory, SafeXMLInputFactory and SafeXPathFactory, whose methods mirror the JAXP static factory methods. The jar becomes a Multi-Release jar: a META-INF/versions/9 layer adds newDefaultInstance/newDefaultFactory and a versions/13 layer adds the newNSInstance family on the two parser factories. Assisted-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWJ4LAxx3TX5RwNvwKbAS3
6 tasks
Member
Author
|
Closing, since #53 was merged instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alternative design for #53, posted for comparison only — no strong preference on which version to choose.
Instead of refactoring
XmlFactoriesinto hardening target factories, this variant splits it into one public utility class per JAXP type (SafeDocumentBuilderFactoryand siblings) whose methods mirror the JAXP static factory methods, and ships the jar as a Multi-Release jar: aMETA-INF/versions/9layer addsnewDefaultInstance()/newDefaultFactory(), and aversions/13layer adds thenewNSInstancefamily on the two parser factories. Verified on the full surefire matrix, the jar-based descriptor/MRJ ITs, and the Android instrumentation suite.🤖 Generated with Claude Code
https://claude.ai/code/session_01WWJ4LAxx3TX5RwNvwKbAS3