As you write "done" please provide link to that code.
Please add in your inputs and algorithm cases for static imports
Why we so validating only private methods ?
--
You received this message because you are subscribed to the Google Groups "Sevntu Checkstyle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sevntu-checkst...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
if (astType != TokenTypes.VARIABLE_DEF |
&& astType != TokenTypes.PARAMETER_DEF |
&& astType != TokenTypes.LITERAL_NEW |
&& astType != TokenTypes.EXPR |
&& astType != TokenTypes.LITERAL_THIS |
|| astType == TokenTypes.LITERAL_NEW |
&& ast.branchContains(TokenTypes.LCURLY)) { |
private void processLiteralNew(DetailAST ast) { |
if (ast.branchContains(TokenTypes.LCURLY)) { |
// ENUM_CONSTANT_DEF cannot have static methods |
frame.isShouldBeProcessed = false; |
currentFrame = child; |
if (!child.isClassOrEnum) { It is not clear why we use currentFrame during validatin. please explain. 6) >
|
--You received this message because you are subscribed to a topic in the Google Groups "Sevntu Checkstyle" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sevntu-checkstyle/cQG-PA0WgvA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sevntu-checkst...@googlegroups.com.
Hi Valislav,
I will continue review after we finish testing of code, please share html reports.
Thanks,
Roman Ivanov
Hi Vladislav,
Selective confirmation is not ok.
Please remove testinputs from testing.
Run report again on one project.
Fix all suggestions, make sure it is compilable.
run report one more time, ensure that contains no violation.
Share with me:
Code before fixes
Report before your fixes
Commit that put static and resolve all violations
Report after fixes, it should have no violations.
Thanks,
Roman Ivanov
You received this message because you are subscribed to the Google Groups "Sevntu Checkstyle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sevntu-checkst...@googlegroups.com.
private void processLiteralNew(DetailAST ast) { |
if (isAnonymousClass(ast)) { |
public int[] getAcceptableTokens() { |
return getDefaultTokens(); |
} |
else { |
currentFrame = child; |
isStaticCandidate = checkFrameExpressions(isStaticCandidate, child); |
} passing field as argument is used when you want to single-out method from relationship to class members, but you continue to use it as field inside. Conflict of intentions. Moreover, it is clear why you need this field during filling structure with data, but it is not clear why it is used in
|
--
public void finishTree(DetailAST ast) { |
checkFrame(currentFrame); |
} you ignore result of method, that should be explain by comment 4) >
|
&& checkFrameExpressions(isStaticCandidate, child) |
&& checkTypes(isStaticCandidate, child); should be
6) > if (child.isShouldBeProcessed) { ... if (child.isPrivateMethod) { |
result = typeFrame == null || typeFrame.isShouldBeProcessed; |
result &= !findTypeVariable(type, frame); combine in one statement. 8) > private static boolean findTypeVariable(String type, Frame frame) { Please use order of arguments like: "where/target/big-object", "what/item/small-object". So your method should be "findTypeVariable(Frame frame, String type)". I did not found explanation of this principle in internet, but here is example - http://docs.guava-libraries.googlecode.com/git-history/release/javadoc/com/google/common/collect/Maps.html#uniqueIndex%28java.lang.Iterable,%20com.google.common.base.Function%29 Please update all other methods, a lot of them have this problem. |
return hasStaticMethod |
&& !hasNonStaticMethod; |
if (parentType == TokenTypes.CLASS_DEF |
|| parentType == TokenTypes.ENUM_DEF) { |
result = false; |
--
if (field != null) { |
result = field; |
break; |
} should be completely removed. |
--
currentFrame.addMethod(ast); |
currentFrame.addChild(frame); |
currentFrame = frame; |
--
isStaticCandidate = !frame.hasLiteralThis |
&& isStaticCandidate move isStaticCandidate to be first in expression 6) >
|
|
|
--
if (astType == TokenTypes.CLASS_DEF |
&& !ScopeUtils.isOuterMostType(ast) |
&& !ast.findFirstToken(TokenTypes.MODIFIERS) |
.branchContains(TokenTypes.LITERAL_STATIC)) { |
--
To unsubscribe from this group and all its topics, send an email to sevntu-checkstyle+unsubscribe@googlegroups.com.