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.

Bug 135881 - Fix Import - Not working
Summary: Fix Import - Not working
Status: RESOLVED DUPLICATE of bug 128326
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-27 14:16 UTC by kaltor
Modified: 2008-05-28 15:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kaltor 2008-05-27 14:16:35 UTC
With the latest version of netbeans (I think it started with 6.1), I've stumbled many issues with the fix import feature.

-A simple one is that fix import does not work (all the time). I have difficulty finding the exact cause of the error,
but for example, this morning, I create a new (empty) class in an existing package x.y.z. I declare a variable from
package x.a.b and try to fix the import automatically but nothing is imported and I get a message telling me there is
nothing to fix (but there is). I can add the import manually, however, and then the class compiles correctly.

-Another issue I've had is when it does work, it misses some classes. It will fix some of the imports, but not all of them.

-Yet another issue i've had is that sometimes, it generates invalid import code. There will be partial import statements
 that cause the entire class to become invalid. But I've never been able to reproduce the exact steps that lead to it.
Could be a race condifition fired when multiple fix import commands are fired at the same time.

One thing I've noticed is that all the imports that do not work belong in my project. Standard java classes are always
imported properly. Moreover, I notice that when I get the Fix All Imports dialog open in a class that contains 'working'
and 'non working' imports, the non working imports have an error message in place of the drop down: 'cannot be resolved'.

I find that this significantly affects my netbeans experience. Enough to revert to an older version, hence why I've put
this as P2.
Comment 1 Jiri Prox 2008-05-28 07:49:20 UTC
Can you please try patch from issue 128326?
Comment 2 kaltor 2008-05-28 14:25:01 UTC
-the latest nightly trunk (200805280004) appears to work properly in regards to the imports. I could not reproduce any
of the issues below. I did a 'clean and build' on the project before trying to reproduce the bugs.

-using the 'official' version I am using, fully updated through 'check for updates', I cannot reproduce these issues in
my project. The issues happened last night however. I tried the latest nightly first.

Hope this helps.
Comment 3 Jiri Prox 2008-05-28 15:10:54 UTC
Thanks for info, the fix from issue 128326 is in trunk build only. We are going to integrate it also in 6.1 as patch 2.
Meanwhile you can fix it manually be following the  guide described in issue 128326. 



*** This issue has been marked as a duplicate of 128326 ***