Corrections for PR #1134
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user