Skip to content

Commit

Permalink
Issue checkstyle#7804: Resolve Pitest Issues - CustomImportOrderCheck…
Browse files Browse the repository at this point in the history
… (3)
  • Loading branch information
DXTkastb committed Apr 18, 2020
1 parent 3dd76b5 commit fc95f97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion .ci/pitest.sh
Expand Up @@ -69,7 +69,6 @@ pitest-header)
pitest-imports)
mvn -e -P$1 clean test org.pitest:pitest-maven:mutationCoverage;
declare -a ignoredItems=(
"CustomImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> if (bestMatch.group.equals(NON_GROUP_RULE_GROUP)) {</span></pre></td></tr>"
"IllegalImportCheck.java.html:<td class='covered'><pre><span class='survived'> if (!result) {</span></pre></td></tr>"
"ImportControlLoader.java.html:<td class='covered'><pre><span class='survived'> else if (ALLOW_ELEMENT_NAME.equals(qName) || &#34;disallow&#34;.equals(qName)) {</span></pre></td></tr>"
"ImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> else if (matcher.start() == bestPos &#38;&#38; matcher.end() &#62; bestEnd) {</span></pre></td></tr>"
Expand Down
Expand Up @@ -786,18 +786,17 @@ else if (customOrderRules.contains(SAME_PACKAGE_RULE_GROUP)) {
bestMatch.matchLength = importPath.length();
}
}
if (bestMatch.group.equals(NON_GROUP_RULE_GROUP)) {
for (String group : customOrderRules) {
if (STANDARD_JAVA_PACKAGE_RULE_GROUP.equals(group)) {
bestMatch = findBetterPatternMatch(importPath,
STANDARD_JAVA_PACKAGE_RULE_GROUP, standardPackageRegExp, bestMatch);
}
if (SPECIAL_IMPORTS_RULE_GROUP.equals(group)) {
bestMatch = findBetterPatternMatch(importPath,
group, specialImportsRegExp, bestMatch);
}
for (String group : customOrderRules) {
if (STANDARD_JAVA_PACKAGE_RULE_GROUP.equals(group)) {
bestMatch = findBetterPatternMatch(importPath,
STANDARD_JAVA_PACKAGE_RULE_GROUP, standardPackageRegExp, bestMatch);
}
if (SPECIAL_IMPORTS_RULE_GROUP.equals(group)) {
bestMatch = findBetterPatternMatch(importPath,
group, specialImportsRegExp, bestMatch);
}
}

if (bestMatch.group.equals(NON_GROUP_RULE_GROUP)
&& customOrderRules.contains(THIRD_PARTY_PACKAGE_RULE_GROUP)
&& thirdPartyPackageRegExp.matcher(importPath).find()) {
Expand Down

0 comments on commit fc95f97

Please sign in to comment.