Allow Utils as suffix

This commit is contained in:
Clément Fournier
2018-05-22 16:06:15 +02:00
parent fe8752bf67
commit 1140c1ec56
2 changed files with 3 additions and 3 deletions

View File

@ -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() {

View File

@ -53,7 +53,7 @@
<description>Utility class convention</description>
<expected-problems>1</expected-problems>
<expected-messages>
<message>The utility class name 'Foo' doesn't match '[A-Z][a-zA-Z0-9]+Util'</message>
<message>The utility class name 'Foo' doesn't match '[A-Z][a-zA-Z0-9]+Utils?'</message>
</expected-messages>
<code><![CDATA[
public class Foo {
@ -144,7 +144,7 @@
<description>Class with only static members except constructors should be a utility class</description>
<expected-problems>1</expected-problems>
<expected-messages>
<message>The utility class name 'Foo' doesn't match '[A-Z][a-zA-Z0-9]+Util'</message>
<message>The utility class name 'Foo' doesn't match '[A-Z][a-zA-Z0-9]+Utils?'</message>
</expected-messages>
<code><![CDATA[
public class Foo {