This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Suppose we have a couple classes: a.Item persistant.Item persistant.ItemUser If ItemUser needs to use a.Item for anything but doesn't use persistant.Item, that class (a.Item) is referred to by FQN. Running the IMT under its default settings will (if it's used the limit number of times of course) change the code so that the Item in the local package is used instead - the import statement is not created for a.Item, because there's a class of that name is in the local package. Shouldn't the import statement be created, or that same-name class be left as FQN by default? IMT breaks the code otherwise.
Try to place the cursor on Item in editor and use alt+shift+i. It is probably what you are looking for.
I'm not looking for a shortcut to create import statements. I am looking for the import management tool (IMT) to not break my code when there are same-named classes in different packages.
Could you show on some example of persistant.ItemUser how it breaks your code, please? I tried you class layout mentioned previously and it works for me.
Created attachment 13988 [details] source that breaks when IMT is run on ItemUser.java
I have attached some example code. IMT breaks the code, though in a slightly different manner than I described originally - it DOES add the import statement for the extra-package class, and it's this which breaks all usage of the package-local class of the same name.
Closing, Import Management Tools was replaced by Fix Import functionality.