diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsRule.java index 7ecb33a569..72568c892a 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsRule.java @@ -31,7 +31,7 @@ public class ClassNamingConventionsRule extends AbstractJavaRule { private static final RegexProperty INTERFACE_REGEX = defaultProp("interface").build(); private static final RegexProperty ENUMERATION_REGEX = defaultProp("enum").build(); private static final RegexProperty ANNOTATION_REGEX = defaultProp("annotation").build(); - private static final RegexProperty UTILITY_CLASS_REGEX = defaultProp("utility class").defaultValue("[A-Z][a-zA-Z0-9]+Util").build(); + private static final RegexProperty UTILITY_CLASS_REGEX = defaultProp("utility class").defaultValue("[A-Z][a-zA-Z0-9]+Utils?").build(); public ClassNamingConventionsRule() { diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/ClassNamingConventions.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/ClassNamingConventions.xml index 179c12384c..f83066bfed 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/ClassNamingConventions.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/ClassNamingConventions.xml @@ -53,7 +53,7 @@ Utility class convention 1 - The utility class name 'Foo' doesn't match '[A-Z][a-zA-Z0-9]+Util' + The utility class name 'Foo' doesn't match '[A-Z][a-zA-Z0-9]+Utils?' Class with only static members except constructors should be a utility class 1 - The utility class name 'Foo' doesn't match '[A-Z][a-zA-Z0-9]+Util' + The utility class name 'Foo' doesn't match '[A-Z][a-zA-Z0-9]+Utils?'