You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When there is a comment before the first import and there is not a space between the comment and the import line.
When running impsort, this comment is duplicated.
Versions (OS, Maven, Java, and others, as appropriate):
Affected version(s) of this project: 1.4.1
OS: MacOS
To Reproduce
Steps to reproduce the behavior (or a link to an example repository that reproduces the problem):
Write any Java file with any imports .
Write a comment above the first import.
// some comment
import foo.bar;
import bar.baz;
class Foo(){
}
Run impsort on the file.
See duplicated comment.
// some comment
// some comment
import foo.bar;
import bar.baz;
class Foo(){
}
Expected behavior
This comment is moved around with the import but not duplicated.
Additional context
This also is an issue with block comments, where the entire block comment is duplicated. In the Maven Debug logs, we see the log that it Found imports: with the comment included above the import line.
The text was updated successfully, but these errors were encountered:
bruce-y
changed the title
Impsort duplicates comments above import
Impsort duplicates comments above import if there is not a package declaration
Oct 1, 2020
bruce-y
changed the title
Impsort duplicates comments above import if there is not a package declaration
Impsort duplicates comments above first import if there is no space separation
Oct 1, 2020
Describe the bug
When there is a comment before the first import and there is not a space between the comment and the import line.
When running impsort, this comment is duplicated.
Versions (OS, Maven, Java, and others, as appropriate):
To Reproduce
Steps to reproduce the behavior (or a link to an example repository that reproduces the problem):
Expected behavior
This comment is moved around with the import but not duplicated.
Additional context
This also is an issue with block comments, where the entire block comment is duplicated. In the Maven Debug logs, we see the log that it
Found imports:
with the comment included above the import line.The text was updated successfully, but these errors were encountered: