Skip to content

Translate XMLStreamReader creation errors to StreamReadException - #883

Merged
cowtowncoder merged 5 commits into
FasterXML:3.xfrom
Sahana2524:wrap-reader-creation-errors
Jul 24, 2026
Merged

Translate XMLStreamReader creation errors to StreamReadException#883
cowtowncoder merged 5 commits into
FasterXML:3.xfrom
Sahana2524:wrap-reader-creation-errors

Conversation

@Sahana2524

Copy link
Copy Markdown
Contributor

XmlFactory._createParser catches only XMLStreamException around createXMLStreamReader:

Wrapped it in all four _createParser overloads; the test uses a stand-in factory that throws at reader creation.

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 73.50% 📉 -0.050%
Branches branches 68.08% 📈 +0.000%

Coverage data generated from JaCoCo test results

@cowtowncoder cowtowncoder changed the title translate XMLStreamReader creation errors to StreamReadException Translate XMLStreamReader creation errors to StreamReadException Jul 23, 2026
@cowtowncoder

Copy link
Copy Markdown
Member

TBH, this sounds like SJSXP bug we should not pave over -- it really should not leak AAOOBEs.

I'll need to think about this a bit...

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 73.56% 📈 +0.000%
Branches branches 68.08% 📈 +0.000%

Coverage data generated from JaCoCo test results

@Sahana2524

Copy link
Copy Markdown
Contributor Author

Agreed, the root cause is SJSXP and ideally it gets fixed there. The reason I went this route is that the next() path already translates the exact same AIOOBE from the SJSXP decoder (Stax2JacksonReaderAdapter, from #618), so createXMLStreamReader() looked like the one remaining boundary where it still escapes as a raw runtime exception. No urgency on my end, happy to adjust if you'd rather handle it differently.

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 73.60% 📉 -0.040%
Branches branches 68.35% 📈 +0.000%

Coverage data generated from JaCoCo test results

@cowtowncoder

Copy link
Copy Markdown
Member

@Sahana2524 actually I agree with your assessment after thinking it through: this is one-off on construction and there's earlier precedents. Thank you!

@cowtowncoder cowtowncoder added this to the 3.3.0 milestone Jul 24, 2026
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 73.59% 📉 -0.050%
Branches branches 68.35% 📈 +0.000%

Coverage data generated from JaCoCo test results

@cowtowncoder
cowtowncoder merged commit df1b701 into FasterXML:3.x Jul 24, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 73.63% 📉 -0.010%
Branches branches 68.40% 📈 +0.050%

Coverage data generated from JaCoCo test results

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.

2 participants