ppkarwasz opened a new pull request, #60:
URL: https://github.com/apache/commons-xml/pull/60

   Exceptions raised while provisioning a secure reader for a `Source` used to 
make round trips between the SAX and TrAX exception hierarchies:
   
   - `SecureSAXParserFactory.secure(Source, boolean)` wrapped 
`ParserConfigurationException`/`SAXException` into a 
`TransformerConfigurationException`, which `SecureValidator.validate` and 
`SecureSchemaFactory` then wrapped back into a `SAXException` — a three-deep 
chain for what began as a `SAXException`.
   - `SecureXMLFilter.parse` buried the parent reader's `SAXParseException` 
under `SAXException(TransformerException(...))`, which a downstream transformer 
consuming the filter wraps into yet another `TransformerException`.
   - `newSecureXMLReader` declared (and documented) a 
`TransformerConfigurationException` it never threw.
   
   Each hierarchy conversion now happens exactly once, at the API boundary 
whose checked signature demands it:
   
   - `SecureSAXParserFactory.newXMLReader` (formerly `newSecureXMLReader`) and 
`secure(Source, boolean)` declare their natural `ParserConfigurationException, 
SAXException`; the validation and schema paths let a `SAXException` propagate 
untouched and wrap only `ParserConfigurationException`.
   - `SecureTransformerFactory.secure(Source, boolean)` is the TrAX flavor, 
converting once to the `TransformerConfigurationException` the TrAX signatures 
demand.
   - `FallbackIgnoreURIResolver` converts locally to `TransformerException` 
(the accurate type for a resolution-time failure), which also keeps the TrAX 
wrappers out of the XPath shading closure (`ShadingFootprintTest`).
   - `SecureXMLFilter.parse` applies the standard TrAX-filter unwrap idiom: a 
`SAXException` or `IOException` cause of the transform's `TransformerException` 
is rethrown directly, so the original `SAXParseException` (with locator info) 
or a handler's own exception surfaces as-is.
   
   Two new `XMLFilterTest` cases pin the unwrap down in the project's 
dual-contract style, tolerating implementations that swallow the error (Xalan) 
or hide it in an internal wrapper (XSLTC) while asserting the original 
exception is never re-wrapped where it does surface.
   
   Full surefire matrix passes.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01RZSVucNBf5fsyd1uqamLuk


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to