From d95534bb53e68ce65097ea78d00850f6145d3a55 Mon Sep 17 00:00:00 2001 From: Ayushman Sachan Date: Thu, 18 Feb 2021 22:57:54 +0530 Subject: [PATCH] Issue #7877: Removed redundant conditional --- .ci/pitest.sh | 1 - .../tools/checkstyle/checks/imports/ImportOrderCheck.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.ci/pitest.sh b/.ci/pitest.sh index ce654611bff..e6ce2a75ed3 100755 --- a/.ci/pitest.sh +++ b/.ci/pitest.sh @@ -64,7 +64,6 @@ pitest-imports) mvn -e -P$1 clean test org.pitest:pitest-maven:mutationCoverage; declare -a ignoredItems=( "ImportControlLoader.java.html:
        else if (ALLOW_ELEMENT_NAME.equals(qName) || "disallow".equals(qName)) {
" - "ImportOrderCheck.java.html:
        return !beforeFirstImport && line - lastImportLine > 1;
" "PkgImportControl.java.html:
        if (alreadyRegex) {
" "PkgImportControl.java.html:
        if (regex || parent.regex) {
" "PkgImportControl.java.html:
        if (regex) {
" diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java index 791e2ec097e..3ad9f997439 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java @@ -875,7 +875,7 @@ private boolean isSeparatorInGroup(int groupIdx, boolean isStatic, int line) { * @return true if there is separator before current import which isn't the first import. */ private boolean isSeparatorBeforeImport(int line) { - return !beforeFirstImport && line - lastImportLine > 1; + return line - lastImportLine > 1; } /**