Generally, I use import [static] foo.*
when I actually want to import everything from foo
. So I'd like Eclipse's Organize Imports to keep any imports with *
as is and not to replace multiple separate imports with *
. Is there a way to do it?
You can set the number of static imports needed to use *
on Preferences > Java > Code Style > Organize Imports
.
better late then never.
(Eclipse EE 2020-06)
Window > Preferences > Java > Code Style > Organize Imports:
at the bottom of the window : Number of imports for .* (...) Number of static imports for .* (...)
both are set to 99, set them to 2.
The second import from the same package will automatically shorten both imports into a single wildcard import (i.e. the one with '*')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With