Repository navigation
[java] Allow numbers in utility class names by default - #1134
Conversation
|
@oowekyala While you are at it, would it make sense to update the pattern to be |
|
I think allowing both |
|
Though it probably would make sense to whitelist utility classes that only have a |
|
@oowekyala amazing! I for one support the inclusion of the |
|
@jsotuyod Ok I see, I think you're right. I'll make the change |
|
|
||
|
|
||
| private boolean isMainMethod(ASTAnyTypeBodyDeclaration bodyDeclaration) { | ||
| if (!DeclarationKind.METHOD.equals(bodyDeclaration.getKind())) { |
There was a problem hiding this comment.
Since DeclarationKind.METHOD is a enum, I would compare it simply with == or directly != in that case.
There was a problem hiding this comment.
Right, I thought CompareObjectsWithEquals would have complained
| && "main".equals(decl.getMethodName()) | ||
| && decl.getResultType().isVoid() | ||
| && decl.getFormalParameters().getParameterCount() == 1 | ||
| && String[].class.equals(decl.getFormalParameters().iterator().next().getType()); |
There was a problem hiding this comment.
Would that cover the varargs case
public static void main(String ... args) { }
too?
There was a problem hiding this comment.
I'm pretty sure it does, but we can add a test case
There was a problem hiding this comment.
yes, it does. Vararg types are resolved to arrays.
|
Note for the one to merge: the branch needs to be deleted from this repo (it doesn't come from my fork). I tried to do the edit on the web UI thinking github would use my fork for the branch but well... |
Refs #1065, this is an oversight
Resolves #1096