Add a schemaLanguage parameter to XmlFactories.newSchemaFactory - #32
Open
ppkarwasz wants to merge 3 commits into
Open
Add a schemaLanguage parameter to XmlFactories.newSchemaFactory#32ppkarwasz wants to merge 3 commits into
ppkarwasz wants to merge 3 commits into
Conversation
Mirror SchemaFactory.newInstance(String): the caller picks the schema language instead of the method hardcoding W3C XML Schema. The hardening is enforced through the LSResourceResolver hook and hardened source rewriting rather than any implementation-specific setting, so it holds for whichever schema language JAXP locates a factory for. Assisted-By: Claude Fable 5 <noreply@anthropic.com>
5 tasks
Member
|
@ppkarwasz |
Member
Author
|
I recently switched to I know you prefer avoiding branches in |
XMLConstants is no longer referenced from XmlFactories. Assisted-By: Claude Fable 5 <noreply@anthropic.com>
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.
Why
XmlFactories.newSchemaFactory()hardcoded W3C XML Schema, while the JAXP API it wraps,SchemaFactory.newInstance(String), lets the caller pick the schema language. Since the library is unreleased there is no compatibility to preserve, so the method itself gains the parameter instead of an overload.What
XmlFactories.newSchemaFactory(String schemaLanguage)passes the language through toSchemaFactory.newInstance(String)and propagates itsIllegalArgumentException/NullPointerExceptioncontract. The hardening is enforced through the factory'sLSResourceResolverhook and hardened source rewriting rather than any implementation-specific setting, so the documented guarantees hold for whichever schema language JAXP locates a factory for.XMLConstants.W3C_XML_SCHEMA_NS_URI.SchemaFactoryLanguageTestcovers the language-selection contract (an unsupported language surfacesIllegalArgumentException); the working W3C path is exercised by the whole schema suite.Testing
Full surefire matrix green (84 reports, zero failures); the new test runs in the schema-tagged executions.
🤖 Generated with Claude Code