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 38095 - [IMT] Netbeans does not handle interfaces and implementors with same name
Summary: [IMT] Netbeans does not handle interfaces and implementors with same name
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
: 38154 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-15 01:48 UTC by _ gtzabari
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Simple patch fixing the problem (4.03 KB, patch)
2004-01-06 09:09 UTC, Dusan Balek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2003-12-15 01:48:14 UTC
dev build 200312141900

   There are multiple issues in Netbeans that
prevent it from properly handling the case where
interface X1.Y is implemented by X2.Y

1) If Import Management Tool is run on:

package X2;
class Y implements X1.Y

  it'll modify the source-code file to read:

package X2;
class Y implements Y

   which results in a compiler error.

2) Furthermore, if X1.Y has a method:

   public void name(X1.Z value);

but X2.Z also exists then running the
SYNCHRONIZATION tool on it will result in pasting:

   public void name(Z value);

into the implementing class X2.Y which also
results in a compiler-error because X2.Z is the
implementation for X1.Z and the function being
implemented specifically refers to the interface
X1.Z not the implementation X2.Z


    I am filing this issue because I deal with
these issues on a daily basis with Netbeans. I
always place all interfaces into one package and
all implementations into another. Getting this to
work under Netbeans is nearly impossible and is
extremely frustrating to constantly correct
compiler-errors the tool itself keeps on
generating. Can you please assess how much work
would be required to fix this issue?

Thank you,
Gili
Comment 1 _ gtzabari 2003-12-15 22:32:09 UTC
Here is a proposed fix for the problem I've reported:

Given:
- file being compiled is source.java, inside package "localPackage"
- source.java contains references to otherPackage.className
- The directory associated with "localPackage" contains a file called
"className.java" or "className.class"
--> Do not remove package name "otherPackage"

   I believe this will solve all the problems I have reported and it
should be quite easy to implement.
Comment 2 Dusan Balek 2004-01-06 09:09:30 UTC
Created attachment 12705 [details]
Simple patch fixing the problem
Comment 3 Dusan Balek 2004-01-06 09:23:35 UTC
*** Issue 38154 has been marked as a duplicate of this issue. ***
Comment 4 Jan Pokorsky 2004-03-11 15:51:39 UTC
ad 1) the patch seems to fix this and looks OK
ad 2) this works for me

Since we are in high resistance mode it is not possible to intagrate
it to release36 and so the target milestone rearranged.
Comment 5 Jan Becicka 2004-06-18 14:02:54 UTC
Closing, Import Management Tools was replaced by Fix Import functionality.