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 71061 - Fix Imports complains about interface constants
Summary: Fix Imports complains about interface constants
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-05 23:41 UTC by _ tboudreau
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Bunch of projects in a zip file, to reproduce the problem (1.88 MB, application/x-compressed)
2006-01-05 23:42 UTC, _ tboudreau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2006-01-05 23:41:35 UTC
In project A, I have interface Foo:

public interface Foo {
   public static final int CONSTANT = 1;
   public int doSomething();
}

In project B, I implement it as an inner class

public class Main {

   private static class Bar implements Foo {
     public int doSomething() {
        return CONSTANT;
     }
   }
}

I run Fix imports on B.Main.  I get an error message telling me Fix Imports 
couldn't identify the class CONSTANT.

Only seems to happen if the interface is in a different project than the 
implementation.  I am using project dependencies, not jar deps.

(Large) example attached.  Unzip the attached zip into contrib/ (that's where 
I have it, don't know if it matters - no nb module projects in it anyway).

Open all the projects.  Open flexdockimaginarymailer.Main as it is now in the 
zip file.  Run Fix Imports against it.  You should see the same thing.
Comment 1 _ tboudreau 2006-01-05 23:42:52 UTC
Created attachment 28220 [details]
Bunch of projects in a zip file, to reproduce the problem
Comment 2 Jan Becicka 2006-01-06 08:14:59 UTC
Dane, please take a look at it. Thanks.
Comment 3 Daniel Prusa 2006-02-14 09:18:25 UTC
Fixed in trunk.

Checking in JavaFixAllImports.java;
/cvs/java/editor/src/org/netbeans/modules/editor/java/JavaFixAllImports.java,v 
<--  JavaFixAllImports.java
new revision: 1.22; previous revision: 1.21