Allow Utils as suffix
This commit is contained in:
@ -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() {
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user