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 50759 - Fix Imports does not always process everything
Summary: Fix Imports does not always process everything
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords: REGRESSION
: 50785 50805 50807 50816 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-22 22:30 UTC by Jesse Glick
Modified: 2007-09-26 09:14 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 Jesse Glick 2004-10-22 22:30:32 UTC
041022 custom, JDK 1.5.0. I have noticed that
sometimes in this build Fix Imports does not
import (or ask about) a few items.

Specifically, in projects/libraries, I deleted all
imports from Library.java and used Fix Imports to
recreate them. It failed to import ResourceBundle.
The background parser, as well as real javac,
considered this an error of course. But I tried
again and again and it just said "All used types
already imported". Fast Import worked fine on this
class.

Similarly, in LibrariesCustomizer.java, F.I.
failed to import NodeOp from org.openide.nodes, or
GridBagConstraints, or a number of other needed
imports.

I don't recall seeing such problems with F.I. in
earlier builds.
Comment 1 Jesse Glick 2004-10-23 00:58:30 UTC
In fact F.I. is pretty much useless in this build. Don't you guys have
unit tests for this?? Seems like it should be straightforward to write
tests for: given a starting file, check what imports are added/removed.
Comment 2 Martin Matula 2004-10-25 10:29:34 UTC
Dane, please look at it.
Comment 3 Daniel Prusa 2004-10-25 12:14:38 UTC
It is reproducible on the following simple source:

public Test {
    public void test() {
        ResourceBundle bundle;
    }
}

The problem is that MultipartId corresponding to "ResourceBundle"
returns null when getElement() is called on it (UnresolvedClass should
be returned). For some types of the local variable this test case
works correctly, for some not (NodeOp is another example).
Comment 4 Tomas Hurka 2004-10-25 14:39:59 UTC
*** Issue 50805 has been marked as a duplicate of this issue. ***
Comment 5 Tomas Hurka 2004-10-25 14:41:42 UTC
*** Issue 50807 has been marked as a duplicate of this issue. ***
Comment 6 Tomas Hurka 2004-10-25 14:49:51 UTC
Fixed in trunk. 
Checking in src/org/netbeans/modules/javacore/jmiimpl/javamodel/
SemiPersistentElement.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/
SemiPersistentElement.java,v  <--  SemiPersistentElement.java
new revision: 1.54; previous revision: 1.53
done
Checking in src/org/netbeans/modules/javacore/jmiimpl/javamodel/UsageFinder.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/
UsageFinder.java,v  <--  UsageFinder.java
new revision: 1.23; previous revision: 1.22
done
Comment 7 Daniel Prusa 2004-10-25 15:41:23 UTC
*** Issue 50785 has been marked as a duplicate of this issue. ***
Comment 8 Daniel Prusa 2004-10-25 15:41:34 UTC
*** Issue 50785 has been marked as a duplicate of this issue. ***
Comment 9 Daniel Prusa 2004-10-26 08:35:31 UTC
*** Issue 50816 has been marked as a duplicate of this issue. ***
Comment 10 Jiri Prox 2005-07-12 14:48:03 UTC
Verified in 4.2 (200507110943)
Comment 11 Quality Engineering 2007-09-20 09:49:19 UTC
Reorganization of java component