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 16320 - Import Management Tool mishandles root package
Summary: Import Management Tool mishandles root package
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC OS/2
: P3 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-08 03:32 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 2001-10-08 03:32:29 UTC
dev build 200110040910
IBM JDK 1.3

I have:

class Server (in the root directory)
class ClientSupport (in package 'gui')

Now, ClientSupport has multiple refers to "Server.MY_CONSTANT" but seeing as it's one directory higher than the root directory it cannot see downward without an 
import statement, and (as far as I know) one cannot simply "import .*". I tried it, it does not work. So I use "import Server;" instead which works.

I then run the Import Management Tool which informs me no identifiers are unresolved. I click on NEXT anyway until I reach the dialog for removing unused import 
statements. 

The dialog suggests I remove "import Server;" which is wrong since the import is required.

Worse yet, if I tell it to keep the reference to "import Server" but change the import to "package import" instead of "class import" it changes "import Server" into 
"import .*" which totally breaks the program. IBM JDK doesn't seem to accept "import .*"

It doesn't throw an error, nor does it actually import anything. I can only assume Sun's JDK does the same.
Comment 1 _ gtzabari 2001-10-08 03:36:30 UTC
Correction: IBM JDK flags "import .*" as "<identifier> expected" 
before the dot. Hence the import statement is invalid.

Does anyone know how one goes about importing the root directory?
Comment 2 Petr Nejedly 2001-10-08 09:54:13 UTC
You cannot import classes from the default package (the "root"
in your words).
Default package is out of the namespaces and classes in default
package can be used only from other classes in default package.
You shouldn't use defualt package for real programming.

Anyway, there is a bug in Java module which handles it badly,
so reassigning to java module and leaving as open
Comment 3 Jan Chalupa 2001-11-27 12:49:42 UTC
Target milestone -> 3.3.1.
Comment 4 Tomas Hurka 2002-01-09 10:40:48 UTC
Already fixed in main trunk by using javac 1.4 code base for parser.
This implementation does not allow to import default package. Will not
be fixed in release33, as workaround use beta version of java module
available from Beta Autoupdate.
Comment 5 Jan Becicka 2002-06-27 13:22:39 UTC
Verified
Comment 6 Quality Engineering 2003-07-01 13:16:34 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.