Inspection Gadgets: bug with unnecessary fully qualified names

Hi, when you have a class that use another class with the same name you
have to fully qualify the classname

public class Label {

public static void main(String[] args) {
Panel p = new Panel();
p.add(new java.awt.Label());

but the inspection will report a verbose or redundant code construct
about java.awt.Label
of course I cannot remove it.




I found out that removing FQCN via quick fix always screws up PSI model, even though everything looks fine on the screen.


I'm having a few problems with FQN inspections as well

whenever i use the intention action to replace with import, IDEA sees errors until i organize imports.

Also, when i inspect a class, i have a lot of classes that are generated and have FQN allover the place, some have more 50 and when i try and replace with import from the inspection panel it does a few but never all, and hitting replace with import does subsequant times does nothing until i re-run inspection again. sometimes i have re-run inspection 3 or 4 times to get them all done.

Another issue that comes up occasionally is, when i do replace with import a lot of times, one by one in a class all imports go grey and basically i can do any intentions and the IDEA does not know what the heck is going on with the class until i close the project and re-open it.


very bizarre stuff with unneccessary FQN.


I'll have a fix in next release. It's one of the tougher inspections, and the algorithm for calculating when a FQN can be shortened is non-obvious. Sorry for the inconvenience.


Please sign in to leave a comment.