I am currently writing a Grails app using IntelliJ. Having migrated from Eclipse, I wanted to enable “organise imports”. If I understand correctly, I had to enable
Settings | Editor | Auto Import | Optimize imports on the fly enabled
All is good, but IntelliJ keeps on removing
import static org.hamcrest.CoreMatchers.is
that I use in my unit tests. It probably does that since it thinks that I mean Groovy’s “is”, but it’s wrong! Any clues on how I prevent it from removing my static import?
It’s a known bug that is already fixed in IDEA 12 EAP.