Skip to content

Split XmlFactories into one Safe factory class per JAXP type (Multi-Release jar) - #54

Closed
ppkarwasz wants to merge 1 commit into
apache:mainfrom
ppkarwasz:feature/safe-factory-classes
Closed

Split XmlFactories into one Safe factory class per JAXP type (Multi-Release jar)#54
ppkarwasz wants to merge 1 commit into
apache:mainfrom
ppkarwasz:feature/safe-factory-classes

Conversation

@ppkarwasz

Copy link
Copy Markdown
Member

Alternative design for #53, posted for comparison only — no strong preference on which version to choose.

Instead of refactoring XmlFactories into hardening target factories, this variant splits it into one public utility class per JAXP type (SafeDocumentBuilderFactory and siblings) whose methods mirror the JAXP static factory methods, and ships the jar as 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. 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

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
@ppkarwasz

Copy link
Copy Markdown
Member Author

Closing, since #53 was merged instead.

@ppkarwasz ppkarwasz closed this Aug 27, 2026
@ppkarwasz
ppkarwasz deleted the feature/safe-factory-classes branch August 27, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant