From fe7a066fe2c19419019312213fd1cde051cc7568 Mon Sep 17 00:00:00 2001 From: yajna pandith Date: Thu, 19 Mar 2020 13:07:14 +0530 Subject: [PATCH] Issue #7877: Fix for ImprtOrderCheck(6) --- .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 aecb3c9eefa..1daa543116b 100755 --- a/.ci/pitest.sh +++ b/.ci/pitest.sh @@ -83,7 +83,6 @@ pitest-imports) "ImportOrderCheck.java.html:
        if (caseSensitive) {
" "ImportOrderCheck.java.html:
                if (!CommonUtil.endsWithChar(pkg, '.')) {
" "ImportOrderCheck.java.html:
        if (isStatic) {
" - "ImportOrderCheck.java.html:
        return !beforeFirstImport && line - lastImportLine > 1;
" "ImportOrderCheck.java.html:
            staticImportSeparator = isStatic && separated;
" "PkgImportControl.java.html:
        if (alreadyRegex) {
" "PkgImportControl.java.html:
        if (regex || parent.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 f8ce7c13553..c68d4b8186e 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 @@ -718,7 +718,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; } /**