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 66304 - [50cat] [Fix imports] do not work for inner classes
Summary: [50cat] [Fix imports] do not work for inner classes
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
: 66519 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-08 04:32 UTC by misterm
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 misterm 2005-10-08 04:32:23 UTC
[ BUILD # : 5.0 beta ]
[ JDK VERSION : 1.4.2_xx ]

Fix imports do not work for inner classes. For example, in a module project that has a dependency on the filesystem API, using code like:

new AtomicAction() {
//...
};

And invoking Fix imports won't add a import for org.openide.filesystems.FileSystem.AtomicAction.
Comment 1 misterm 2005-10-10 14:44:20 UTC
I've noticed sometimes it works fine, but hints never work in such case, i.e., 
there is no suggestion to import the class nor to implement its abstract 
methods once it's imported. I am not sure another issue should be opened to 
track this or if they are related problems.
Comment 2 Max Sauer 2005-10-10 15:33:52 UTC
Cannot reproduce both in 5.0beta and nbdev 051010. Please be more specific or
send us your project/usecase, Thanks.
Comment 3 misterm 2005-10-10 15:55:44 UTC
I've found this problem while working on a patch for another issue:

http://www.netbeans.org/nonav/issues/showattachment.cgi/25698/cvsrootselector.zi
p

Look for CvsRootRewriter, remove the import for FileSystem.AtomicAction and 
comment the run method. Editor hints are not displayed all the times for me 
(neither for importing nor for implementing all abstract methods) and Fix 
imports sometimes works, sometimes doesn't.
Comment 4 Daniel Prusa 2005-10-11 15:15:33 UTC
There was a problem with hints suggesting to implement abstract methods in
anonymous inner classes - NPE was thrown during creation of such hints. It is
fixed in trunk now. After this fix, I am not able to reproduce the problem with
the imports.

/cvs/java/hints/src/org/netbeans/modules/java/hints/JavaHintsProvider.java
new revision: 1.50; previous revision: 1.49
Comment 5 Pavel Flaska 2005-10-12 08:38:53 UTC
*** Issue 66519 has been marked as a duplicate of this issue. ***
Comment 6 misterm 2005-10-14 20:04:26 UTC
Works on Q-Build 20051013