Normalize lazy StAX parse failures in MavenXpp3Reader (backport of #13117 to maven-4.0.x) - #13149
Merged
Merged
Conversation
* Normalize lazy StAX parse failures in MavenXpp3Reader Woodstox can defer malformed character-reference errors until text access and wrap the XMLStreamException in a runtime exception. MavenXpp3Reader currently translates only directly thrown XMLStreamException values, allowing the lazy wrapper to escape the declared XmlPullParserException contract. Translate runtime exceptions whose cause is an XMLStreamException while preserving unrelated runtime failures. Add regression coverage for both Reader and InputStream paths. Signed-off-by: Robert McConnell <robert@mcc0nnell.org> * Extend lazy StAX exception fix to SettingsXpp3Reader, MetadataXpp3Reader, MavenToolchainsXpp3Reader Same WstxLazyException escape path exists in all four compat readers. Also strengthen the test to assert the cause is an XMLStreamException. * Extend RuntimeException guard to XMLStreamReader overloads in Settings/MetadataXpp3Reader --------- Signed-off-by: Robert McConnell <robert@mcc0nnell.org> Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
gnodet-bot
approved these changes
Sep 15, 2026
gnodet-bot
left a comment
There was a problem hiding this comment.
Clean backport of #13117 to maven-4.0.x (cherry-pick of 030cb93, applied without conflicts).
The fix is structurally identical to the approved original:
MavenXpp3Reader: both Reader and InputStreamread()overloads patchedMetadataXpp3Reader/SettingsXpp3Reader: Reader, InputStream, and XMLStreamReader overloads all covered (5 overloads each)MavenToolchainsXpp3Reader: one patch onread(Reader, boolean, strict)is sufficient — the InputStream overloads chain through it (read(InputStream, boolean)→read(XmlStreamReader, boolean)→read(Reader, boolean)), so coverage is completeMavenXpp3ReaderTestcarries over and exercises both Reader and InputStream paths
All findings from the original multi-round review of #13117 were addressed before merge; this backport inherits that clean state.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
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.
Backport of #13117 to the
maven-4.0.xbranch.Cherry-pick of 030cb93, applied cleanly with no conflicts.