-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Description
Identified in #4109 (comment) ,
ParenPad is doing a deep scan for tokens to check at
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheck.java
Lines 179 to 198 in e70836b
private void processExpression(DetailAST ast) { | |
if (ast.branchContains(TokenTypes.LPAREN)) { | |
DetailAST childAst = ast.getFirstChild(); | |
while (childAst != null) { | |
if (childAst.getType() == TokenTypes.LPAREN) { | |
processLeft(childAst); | |
processExpression(childAst); | |
} | |
else if (childAst.getType() == TokenTypes.RPAREN && !isInTypecast(childAst)) { | |
processRight(childAst); | |
} | |
else if (!isAcceptableToken(childAst)) { | |
//Traverse all subtree tokens which will never be configured | |
//to be launched in visitToken() | |
processExpression(childAst); | |
} | |
childAst = childAst.getNextSibling(); | |
} | |
} | |
} |
This caused tokens that were specifically not set in the configuration to be picked up for violations as seen in Issue #3048.
It is weird to validate tokens outside of check's configuration and users won't be expecting this. It even caused no differences to appear in regression reports for default module even when new token was added to the check. We only saw differences when running on very limited/specific tokens.
We need to remove this deep scan from the check.
We then need to identify if there are any differences in the regression report. If there are any differences, those areas have to be identified and added as new tokens to the check.
When all this is done, we expect no differences for default module in regression on final implementation. Differences on specific tokens is ok.
Metadata
Metadata
Assignees
Type
Projects
Status
No status