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 cf95afe3d51d7902415ef6383829c0c893f98b0a Author: Gary Gregory <[email protected]> AuthorDate: Fri Aug 28 13:21:25 2026 -0400 Rename HardeningValidator to SecureValidator. Local build OK. --- src/main/java/org/apache/commons/xml/SecureSchema.java | 4 ++-- src/main/java/org/apache/commons/xml/SecureSchemaFactory.java | 2 +- .../commons/xml/{HardeningValidator.java => SecureValidator.java} | 4 ++-- src/test/java/org/apache/commons/xml/ShadingFootprintTest.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/commons/xml/SecureSchema.java b/src/main/java/org/apache/commons/xml/SecureSchema.java index 011eb1b..745ed4e 100644 --- a/src/main/java/org/apache/commons/xml/SecureSchema.java +++ b/src/main/java/org/apache/commons/xml/SecureSchema.java @@ -25,7 +25,7 @@ /** * {@link Schema} wrapper that hardens every {@link Validator} and {@link ValidatorHandler} the inner Schema produces: each {@link Validator} is wrapped in - * {@link HardeningValidator} (which rewrites the Source through {@link SecureSAXParserFactory#harden(javax.xml.transform.Source, boolean)} and installs the resolver + * {@link SecureValidator} (which rewrites the Source through {@link SecureSAXParserFactory#harden(javax.xml.transform.Source, boolean)} and installs the resolver * floor), and each {@link ValidatorHandler} is wrapped in a {@link HardeningValidatorHandler} that keeps the same ignore-all resolver floor so * {@code xsi:schemaLocation} is not resolved during SAX-driven validation. */ @@ -52,7 +52,7 @@ final class SecureSchema extends Schema { @Override public Validator newValidator() { - return new HardeningValidator(delegate.newValidator(), overrideDefaultParser); + return new SecureValidator(delegate.newValidator(), overrideDefaultParser); } @Override diff --git a/src/main/java/org/apache/commons/xml/SecureSchemaFactory.java b/src/main/java/org/apache/commons/xml/SecureSchemaFactory.java index 5e8bf10..924e93e 100644 --- a/src/main/java/org/apache/commons/xml/SecureSchemaFactory.java +++ b/src/main/java/org/apache/commons/xml/SecureSchemaFactory.java @@ -153,7 +153,7 @@ private SecureSchemaFactory() { * through {@link SecureSAXParserFactory#harden(Source, boolean)}.</li> * <li>{@link SecureSchema} wraps every Validator/ValidatorHandler the inner Schema produces and re-installs the floor on each (blocking * {@code xsi:schemaLocation} at validation time), since neither the JDK nor Xerces reliably propagates it through {@code Schema}.</li> - * <li>{@link HardeningValidator} rewrites the Source on every {@link Validator#validate(Source)} call.</li> + * <li>{@link SecureValidator} rewrites the Source on every {@link Validator#validate(Source)} call.</li> * </ol> * * <p> diff --git a/src/main/java/org/apache/commons/xml/HardeningValidator.java b/src/main/java/org/apache/commons/xml/SecureValidator.java similarity index 97% rename from src/main/java/org/apache/commons/xml/HardeningValidator.java rename to src/main/java/org/apache/commons/xml/SecureValidator.java index bab0002..41f9edb 100644 --- a/src/main/java/org/apache/commons/xml/HardeningValidator.java +++ b/src/main/java/org/apache/commons/xml/SecureValidator.java @@ -37,7 +37,7 @@ * {@link SecureSAXParserFactory#harden(Source, boolean)} before delegating, and keeps an ignore-all {@link LSResourceResolver} floor so {@code xsi:schemaLocation} is not resolved at * validation time. {@link #reset()} re-establishes the bare ignore-all floor, matching the just-constructed state. */ -final class HardeningValidator extends Validator { +final class SecureValidator extends Validator { private final Validator delegate; @@ -56,7 +56,7 @@ final class HardeningValidator extends Validator { * @param overrideDefaultParser whether the source rewrites should use the pluggable parser lookup instead of the platform's built-in parser. * @throws NullPointerException if {@code delegate} is {@code null}. */ - HardeningValidator(final Validator delegate, final boolean overrideDefaultParser) { + SecureValidator(final Validator delegate, final boolean overrideDefaultParser) { this.delegate = Objects.requireNonNull(delegate, "delegate"); this.overrideDefaultParser = overrideDefaultParser; // Block xsi:schemaLocation resolution; neither the JDK nor Xerces reliably propagates the factory's resolver to its Validators. The floor is a diff --git a/src/test/java/org/apache/commons/xml/ShadingFootprintTest.java b/src/test/java/org/apache/commons/xml/ShadingFootprintTest.java index aa9b6db..39a0b6c 100644 --- a/src/test/java/org/apache/commons/xml/ShadingFootprintTest.java +++ b/src/test/java/org/apache/commons/xml/ShadingFootprintTest.java @@ -164,7 +164,7 @@ class ShadingFootprintTest { "SecureSchemaFactory", "SecureSchemaFactory$1", "SecureSchemaFactory$Wrapper", - "HardeningValidator", + "SecureValidator", "HardeningValidatorHandler", "HardeningXMLReader"); // @formatter:on
