This is an automated email from the ASF dual-hosted git repository. garydgregory pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/commons-xml.git
commit 886dcd80c42babf8c8f3bd7593f1cac92fd7b813 Author: Gary Gregory <[email protected]> AuthorDate: Fri Aug 28 13:15:03 2026 -0400 Rename HardeningSAXParser to SecureSAXParser. --- .../java/org/apache/commons/xml/HardeningSAXParserFactory.java | 4 ++-- .../commons/xml/{HardeningSAXParser.java => SecureSAXParser.java} | 4 ++-- src/test/java/org/apache/commons/xml/ShadingFootprintTest.java | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/apache/commons/xml/HardeningSAXParserFactory.java b/src/main/java/org/apache/commons/xml/HardeningSAXParserFactory.java index d3c585c..7c09f04 100644 --- a/src/main/java/org/apache/commons/xml/HardeningSAXParserFactory.java +++ b/src/main/java/org/apache/commons/xml/HardeningSAXParserFactory.java @@ -346,7 +346,7 @@ public void setFeature(final String name, final boolean value) throws SAXNotReco * Universal SAX factory wrapper that funnels every produced parser through {@link HardeningSAXParserFactory#harden(XMLReader)}. * <p> * {@link SAXParserFactory} exposes only a feature API and no property API, so the per-parse hardening (limits, entity blocking, implementation-specific fixups) - * has to run on each {@link XMLReader} the factory produces. This wrapper returns a {@link HardeningSAXParser}, which applies that hardening lazily to both the + * has to run on each {@link XMLReader} the factory produces. This wrapper returns a {@link SecureSAXParser}, which applies that hardening lazily to both the * SAX 2 {@link XMLReader} and the SAX 1 {@link org.xml.sax.Parser} it exposes. * </p> * @@ -393,7 +393,7 @@ public boolean isXIncludeAware() { @Override public SAXParser newSAXParser() throws ParserConfigurationException, SAXException { - return new HardeningSAXParser(delegate.newSAXParser()); + return new SecureSAXParser(delegate.newSAXParser()); } @Override diff --git a/src/main/java/org/apache/commons/xml/HardeningSAXParser.java b/src/main/java/org/apache/commons/xml/SecureSAXParser.java similarity index 97% rename from src/main/java/org/apache/commons/xml/HardeningSAXParser.java rename to src/main/java/org/apache/commons/xml/SecureSAXParser.java index 162332c..8fb08c4 100644 --- a/src/main/java/org/apache/commons/xml/HardeningSAXParser.java +++ b/src/main/java/org/apache/commons/xml/SecureSAXParser.java @@ -40,7 +40,7 @@ * every parse must run through the same instance. The {@code parse(...)} overloads inherited from {@link SAXParser} dispatch virtually to {@link #getXMLReader()} * and {@link #getParser()}, so they too run through the hardened views without further overrides.</p> */ -final class HardeningSAXParser extends SAXParser { +final class SecureSAXParser extends SAXParser { private final SAXParser delegate; @@ -53,7 +53,7 @@ final class HardeningSAXParser extends SAXParser { * @param delegate the delegate to wrap; must not be {@code null}. * @throws NullPointerException if {@code delegate} is {@code null}. */ - HardeningSAXParser(final SAXParser delegate) { + SecureSAXParser(final SAXParser delegate) { this.delegate = Objects.requireNonNull(delegate, "delegate"); } diff --git a/src/test/java/org/apache/commons/xml/ShadingFootprintTest.java b/src/test/java/org/apache/commons/xml/ShadingFootprintTest.java index 209db87..d870d8f 100644 --- a/src/test/java/org/apache/commons/xml/ShadingFootprintTest.java +++ b/src/test/java/org/apache/commons/xml/ShadingFootprintTest.java @@ -70,7 +70,7 @@ class ShadingFootprintTest { private static final Set<String> SAX_PARSER_FACTORY = set( "FallbackIgnoreEntityResolver2", "SecureException", - "HardeningSAXParser", + "SecureSAXParser", "HardeningSAXParserFactory", "HardeningSAXParserFactory$1", "HardeningSAXParserFactory$HardeningExpatXMLReader", @@ -103,7 +103,7 @@ class ShadingFootprintTest { "SecureDocumentBuilderFactory$1", "SecureDocumentBuilderFactory$Wrapper", "SecureException", - "HardeningSAXParser", + "SecureSAXParser", "HardeningSAXParserFactory", "HardeningSAXParserFactory$1", "HardeningSAXParserFactory$HardeningExpatXMLReader", @@ -133,7 +133,7 @@ class ShadingFootprintTest { "SecureDocumentBuilderFactory$Wrapper", "MethodHandleFactory", "SecureException", - "HardeningSAXParser", + "SecureSAXParser", "HardeningSAXParserFactory", "HardeningSAXParserFactory$1", "HardeningSAXParserFactory$HardeningExpatXMLReader", @@ -155,7 +155,7 @@ class ShadingFootprintTest { "FallbackIgnoreEntityResolver2", "FallbackIgnoreLSResourceResolver", "SecureException", - "HardeningSAXParser", + "SecureSAXParser", "HardeningSAXParserFactory", "HardeningSAXParserFactory$1", "HardeningSAXParserFactory$HardeningExpatXMLReader",
