Skip to content

Commit

Permalink
Issue checkstyle#7799: Resolve Pitest Issues - AvoidStarImportCheck (1)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilcoln committed Mar 15, 2020
1 parent 5ec8cfe commit 5608481
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion .ci/pitest.sh
Expand Up @@ -71,7 +71,6 @@ pitest-header)
pitest-imports)
mvn -e -P$1 clean test org.pitest:pitest-maven:mutationCoverage;
declare -a ignoredItems=(
"AvoidStarImportCheck.java.html:<td class='covered'><pre><span class='survived'> &#38;&#38; ast.getType() == TokenTypes.STATIC_IMPORT) {</span></pre></td></tr>"
"CustomImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> else if (customImportOrderRules.contains(SAME_PACKAGE_RULE_GROUP)) {</span></pre></td></tr>"
"CustomImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> if (bestMatch.group.equals(NON_GROUP_RULE_GROUP)) {</span></pre></td></tr>"
"CustomImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> if (customImportOrderRules.contains(SAME_PACKAGE_RULE_GROUP)) {</span></pre></td></tr>"
Expand Down
Expand Up @@ -216,12 +216,13 @@ public void setAllowStaticMemberImports(boolean allow) {

@Override
public void visitToken(final DetailAST ast) {
if (!allowClassImports && ast.getType() == TokenTypes.IMPORT) {
final DetailAST startingDot = ast.getFirstChild();
logsStarredImportViolation(startingDot);
if(ast.getType() == TokenTypes.IMPORT) {
if (!allowClassImports) {
final DetailAST startingDot = ast.getFirstChild();
logsStarredImportViolation(startingDot);
}
}
else if (!allowStaticMemberImports
&& ast.getType() == TokenTypes.STATIC_IMPORT) {
else if (!allowStaticMemberImports) {
// must navigate past the static keyword
final DetailAST startingDot = ast.getFirstChild().getNextSibling();
logsStarredImportViolation(startingDot);
Expand Down

0 comments on commit 5608481

Please sign in to comment.