Corrections for PR #1134

This commit is contained in:
Clément Fournier
2018-05-23 21:25:22 +02:00
parent 89bc6c94c8
commit c80cfd6113
2 changed files with 14 additions and 1 deletions

View File

@ -108,7 +108,7 @@ public class ClassNamingConventionsRule extends AbstractJavaRule {
private boolean isMainMethod(ASTAnyTypeBodyDeclaration bodyDeclaration) {
if (!DeclarationKind.METHOD.equals(bodyDeclaration.getKind())) {
if (DeclarationKind.METHOD != bodyDeclaration.getKind()) {
return false;
}

View File

@ -228,6 +228,19 @@
]]></code>
</test-code>
<test-code>
<description>Class with only main method should not be utility class - varargs case</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class MyException {
public static void main(String... args) {
// whitelisted
}
}
]]></code>
</test-code>
<test-code>
<description>Class with main method and private static fields should not be utility class</description>
<expected-problems>0</expected-problems>