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 27671 - [IMT] Import Manager removes FQN even when conflict exists
Summary: [IMT] Import Manager removes FQN even when conflict exists
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-29 01:10 UTC by _ gtzabari
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 _ gtzabari 2002-09-29 01:10:24 UTC
Within one of my programs I have both
"javax.swing.text.Style" and
"com.shadowcraft.eggshell.Style" defined.

Now, since the source-code in question resides
within com.shadowcraft.eggshell, I don't need to
import com.shadowcraft.eggshell.Style to use it.
There is an instance where I specifically refer to
javax.swing.text.Style but the import manager
removes it (reduces it to "Style") because it sees
an import statement exists for javax.swing.text.Style.

The import manager should be smart enough to see a
FQN is required and not bother adding an import
statement for javax.swing.text.Style either.
Comment 1 Marian Mirilovic 2002-10-11 11:19:44 UTC
Import management tool comes from java module.
Comment 2 _ gtzabari 2002-10-29 03:05:39 UTC
Another related issue..

1) originally the code contains:

import java.awt.Color;
import java.awt.Container;

2) You run IMPORT MANAGER on the current class, contained within
package "com.company.project"

3) com.company.project.Color exists, which is why the original code
explicitly mentioned "import java.awt.Color" to override the Color
found in the current package.

4) After running IMPORT MANAGER, the imports are collapsed into
"import.awt.*" which results in com.company.project.Color overriding
java.awt.Color

   This is undesired behavior.
Comment 3 _ gtzabari 2003-02-27 23:15:47 UTC
This issue causes code corruption. Upgrading to P2.
Comment 4 Tomas Hurka 2003-03-04 13:48:42 UTC
You can always use Undo to return to the previous state. In general IMT is not capable to prevent creating of non-compilable code. Lowering priority to P3 - there is easy workaround and the issue itself is corner case. It cannot be easily fixed with current infrastructure, setting Target Milestone to 4.0
Comment 5 _ gtzabari 2003-05-27 06:24:43 UTC
Grr.. this issue is getting annoying :) I run into it quite frequently.

Specifically, I am implementing
javax.sound.sampled.spi.AudioFileReader, my code is called
com.shadowcraft.spi.sampled.mod.AudioFileReader

The package name is obviously different but I mirror the actual class
name after the class I am implementing. In the aforementioned example,
I am implementing an AudioFileReader for the MOD audio format.

Are we sure we can't get a fix in before 4.0? Is this issue really
that difficult to fix?
Comment 6 Tomas Hurka 2003-05-27 07:55:15 UTC
I am sorry, but this issue will not be fixed in 3.5
Comment 7 Antonin Nebuzelsky 2003-11-04 14:58:55 UTC
Fixed in Nevada Patch 1 and in Arrow.
Comment 8 _ gtzabari 2003-12-07 22:55:41 UTC
Tomas, Antonin,

   Can you please merge the fix from "Nevada Patch 1 and Arrow" into
the main dev branch. I can still reproduce the problem as of dev build
200311301900 and as I mentioned before I'd appreciate a quick fix for
this issue as I run into it frequently.
Comment 9 Tomas Hurka 2004-02-19 09:43:43 UTC
Honzo, please merge the fix from "Nevada Patch 1 and Arrow" into trunk. Thanks.
Comment 10 Martin Matula 2004-06-18 19:24:46 UTC
Closing, Import Management Tool was replaced by Fix Import functionality.
Comment 11 _ gtzabari 2004-06-19 10:27:31 UTC
Instead of closing as WON'T FIX, you should have redirected all IMT
issues to the new FIX IMPORT tool where they could be closed if necessary.