-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance Import Sorter/Order to cope with multi-line comments and misp…
…laced imports
- Loading branch information
Showing
5 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
testlib/src/test/resources/java/importsorter/JavaCodeImportComments.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import static java.lang.Exception.*; | ||
//Will be removed | ||
import org.dooda.Didoo; /* Comment removed, import stays */ | ||
import java.lang.Thread; /* Don't */ /* get */ /* confused */ | ||
import java.lang.Runnable; | ||
/* import org.comments.will | ||
import org.comments.be | ||
import org.comments.removed | ||
*/ | ||
import static java.lang.Runnable.*; | ||
/* | ||
import other.multiline.comments | ||
import will.be.removed.too */ | ||
import static com.foo.Bar |
13 changes: 13 additions & 0 deletions
13
testlib/src/test/resources/java/importsorter/JavaCodeSortedMisplacedImports.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import java.lang.Runnable; | ||
import java.lang.Thread; | ||
|
||
import org.dooda.Didoo; | ||
|
||
import static java.lang.Exception.*; | ||
import static java.lang.Runnable.*; | ||
|
||
import static com.foo.Bar; | ||
public class NotDeletedByFormatter { | ||
} | ||
import will.not; | ||
import be.sorted; |
16 changes: 16 additions & 0 deletions
16
testlib/src/test/resources/java/importsorter/JavaCodeUnsortedMisplacedImports.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import static java.lang.Exception.*; | ||
import org.dooda.Didoo; | ||
/* | ||
public class IgnoredAndRemoved { | ||
} | ||
*/ | ||
import java.lang.Thread; | ||
// Will be removed {} | ||
import java.lang.Runnable; | ||
|
||
import static java.lang.Runnable.*; | ||
import static com.foo.Bar | ||
public class NotDeletedByFormatter { | ||
} | ||
import will.not; | ||
import be.sorted; |