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.
When using generics, It is not uncommon to use a type expression like Foo<Bar>. The "Fix Imports" tool (Alt-Shift-F) doesn't find the nested type Bar, causing the import of Bar to be removed. Fix Imports is a very nice feature, but it must be very reliable, especially since there is no Undo. In the following example, the import of java.util.List will be removed when using Fix Imports. --- import java.util.List; interface Foo<T> { Foo<List<?>> get(); }
Fixed. Checking in JavaFixAllImports.java; /cvs/editor/src/org/netbeans/modules/editor/java/JavaFixAllImports.java,v <-- JavaFixAllImports.java new revision: 1.11; previous revision: 1.10
This bug has been fixed only partly (Q-build 2004-08-12). Undo has been fixed, but in the example, java.util.List is still removed by Fix Imports. List is used in the declaration of Foo.get(), so it should not be removed from the imports. Initially I set this bug's subcomponent to "srcmodel" because maybe the nested type expressions are correctly scanned, but ignored further on. My knowledge of NetBeans' internals are insufficient to be sure though.
The bug is reproducible in Q-build 2004-08-12, but it is fixed in the following dev builds (the related commit was not included into the Q-build).
Reorganization of java component