Mark private classes final

See gh-1479
This commit is contained in:
Stéphane Nicoll
2025-03-07 13:04:48 +01:00
parent 360f52379b
commit 00e1e68062
48 changed files with 70 additions and 69 deletions

View File

@@ -48,7 +48,7 @@ abstract class Jaxp13ValidatorFactory {
}
}
private static class Jaxp13Validator implements XmlValidator {
private static final class Jaxp13Validator implements XmlValidator {
private Schema schema;
@@ -82,7 +82,7 @@ abstract class Jaxp13ValidatorFactory {
/**
* {@code ErrorHandler} implementation that stores errors and fatal errors in a list.
*/
private static class DefaultValidationErrorHandler implements ValidationErrorHandler {
private static final class DefaultValidationErrorHandler implements ValidationErrorHandler {
private List<SAXParseException> errors = new ArrayList<>();

View File

@@ -56,7 +56,7 @@ abstract class Jaxp15ValidatorFactory {
}
}
private static class Jaxp15Validator implements XmlValidator {
private static final class Jaxp15Validator implements XmlValidator {
private Schema schema;
@@ -111,7 +111,7 @@ abstract class Jaxp15ValidatorFactory {
/**
* {@code ErrorHandler} implementation that stores errors and fatal errors in a list.
*/
private static class DefaultValidationErrorHandler implements ValidationErrorHandler {
private static final class DefaultValidationErrorHandler implements ValidationErrorHandler {
private List<SAXParseException> errors = new ArrayList<>();

View File

@@ -60,7 +60,7 @@ public abstract class AbstractXPathTemplate extends TransformerObjectSupport imp
* Static inner class that adapts a {@link NodeCallbackHandler} to the interface of
* {@link NodeMapper}.
*/
private static class NodeCallbackHandlerNodeMapper implements NodeMapper<Object> {
private static final class NodeCallbackHandlerNodeMapper implements NodeMapper<Object> {
private final NodeCallbackHandler callbackHandler;

View File

@@ -75,7 +75,7 @@ abstract class JaxenXPathExpressionFactory {
}
/** Jaxen implementation of the {@code XPathExpression} interface. */
private static class JaxenXpathExpression implements XPathExpression {
private static final class JaxenXpathExpression implements XPathExpression {
private XPath xpath;

View File

@@ -90,7 +90,7 @@ abstract class Jaxp13XPathExpressionFactory {
}
/** JAXP 1.3 implementation of the {@code XPathExpression} interface. */
private static class Jaxp13XPathExpression implements XPathExpression {
private static final class Jaxp13XPathExpression implements XPathExpression {
private final javax.xml.xpath.XPathExpression xpathExpression;

View File

@@ -164,7 +164,7 @@ public class Jaxp13XPathTemplate extends AbstractXPathTemplate {
return this.xpathFactory.newXPath();
}
private static class EvaluationCallback implements TraxUtils.SourceCallback {
private static final class EvaluationCallback implements TraxUtils.SourceCallback {
private final XPath xpath;

View File

@@ -236,7 +236,7 @@ public class CommonsXsdSchemaCollection implements XsdSchemaCollection, Initiali
return builder.toString();
}
private class ClasspathUriResolver extends DefaultURIResolver {
private final class ClasspathUriResolver extends DefaultURIResolver {
@Override
public InputSource resolveEntity(String namespace, String schemaLocation, String baseUri) {

View File

@@ -56,7 +56,7 @@ public class XmlValidatorFactoryTest {
.createValidator(new ClassPathResource("schema.xsd", AbstractValidatorFactoryTest.class), "bla"));
}
private static class NonExistentResource extends AbstractResource {
private static final class NonExistentResource extends AbstractResource {
@Override
public Resource createRelative(String relativePath) throws IOException {