-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle case where imports occur on the same line as other statements #1
Labels
Comments
ctubbsii
added a commit
that referenced
this issue
Jul 21, 2017
Replace regex parsing with proper java source file parser Organize code a bit better, with Grouper class This version doesn't have the false-positive detection on well-formed Java files, but I have noticed that Java files which put the package statement before the compilation unit / file header comment do get that comment duplicated. This version handles multiple imports on a single line perfectly well. This version does have issues if the first import occurs on the same line as the package statement, or if the last import occurs on the same line as the beginning of the class. This should be corrected in a future version (See issue #1).
This was referenced Sep 8, 2020
This isn't really that critical of an issue. The workaround is to format your code using a different plugin before ordering your imports, and to just not put things on the same line. I've had 0 people report this is actually a problem, so it's probably not worth spending any time on. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the first import occurs on the same line as the package statement, the package statement will get deleted.
If the last import occurs on the same line as the start of the class, the class start will get deleted.
These can be fixed by tracking where within these lines one begins and the other ends.
The text was updated successfully, but these errors were encountered: