Summary: | packages with javax in their name don't import properly | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Eric M. Smith <esmith> | ||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||
Status: | RESOLVED DUPLICATE | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | ||||||||
Version: | 2.1 | ||||||||
Target Milestone: | 2.1 RC3 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows 2000 | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Eric M. Smith
2003-03-05 13:45:32 EST
Could you please provide a reproducable test case and specify the build you are using? I tried the following test case with no success: 1) Start a fresh workspace 2) Create a Java project P 3) Create a package called p1.p2.javax.p3 4) Create a class A in this package that looks like: package p1.p2.javax.p3; public class A { public int foo() { return 0; } } 5) Create a package p4. 6) Create a class B in p4 that looks like this: package p4; import p1.p2.javax.p3.A; public class B { int j; B() { j = new A().foo(); } } 7) This code compiles fine without any error related to the package name containing javax. Anything wrong in my steps? I used JDK1.4.1 for my test case. What JDK/JRE are you using? I tried with a JDK 1.3.1, different package names containing javax without being able to reproduce this problem. Need steps to reproduce and investigate further. Eric - can you provide us with the offending library for testing purpose ? The following class cannot be referenced from an outside package /*ListPanel.java*/ package com.infostructuresys.edge.core.javax.list; import javax.swing.*; import javax.swing.event.*; import java.awt.*; public class ListPanel extends JPanel { } /*Referencing class*/ import com.infostructuresys.edge.core.javax.list.*; <-import not resolved public class foo { private ListPanel pnlList; <-task error indicates this is unresolvable ... } One error in the task list indicates the package com.infostructuresys.edge.core.javax cannot be resolved *NOT* com.infostructuresys.edge.core.javax.list as the import declaration indicates. This error does not occur in the 2.0.2 version of eclipse, I do get this error in eclipse build 200302141436, others have seen it in M4, M5 and RC1 of 2.1 tree. I was using both java versions 1.3.1_02 and 1.3.1_07 if that helps. Thanks. Created attachment 3922 [details]
Test case
I tried the following classes in RC1. Unzip the attachement in a source folder
and refresh the source folder. I could not reproduce.
The only other thing I can think of that differs, is that this problem only showed up when our source count went over 2500 (we have somewhere around 2600 java files in our project in various packages). I've been experimenting further with this problem. I renamed the packages com.infostructuresys.edge.core.javax.* plus all package declarations of classes in those packages to com.infostructuresys.edge.core.other.* and the problem went away. IMO not a real good workaround, but... More info that may or may not be of help. We have another package in our heirarchy called com.infostructuresys.edge.javax.*. These classes have existed for months without incident until recently when the java file count went from ~2000 to ~2500 suddenly. BTW the problem still exists in RC2, and this workaround was tested in RC2. Thanks again. Could you please provide the complete test case with all the source files il a zipped file if it is not too big? We need to be able to reproduce this situation if we want to be able to fix it. Thanks for your help. Do you have any error in your code except these import problems? In my most recent build of our source, the only outstanding errors are all derived from the 10 failures to resolve the com.infostructuresys.edge.core.javax...* packages. There are about 500 "errors", but 10 are unknown import errors while the rest are unresolved references to the classes in the failed imports. I tried to create test cases with 3000 files in packages containing javax, but I cannot reproduce the problem. I will attach the test case here. Could you please try it to see if you see the problem with it? Thanks. Created attachment 3989 [details]
Test case generator
Use a fresh workspace to test this code.
Save the contents of this attachement in a compilation unit and run it in
Eclipse and copy the contents of d:/temp/src into a source folder.
I tried to attach the result, but it takes too long (The zip file was closed to
1Mb).
Let me know if you can reproduce your problem.
Could you please try to reproduce the problem on your side using the test case I provided? It doesn't work for me, but I'd like to find out what is wrong. We need your help since you seem to be the only one you got this problem and we cannot get your workspace to investigate. RC3 is next week. So if we don't find before this date, we won't be able to fix it for 2.1. Suspect this is a duplicate of bug 35128, please give a try to patch posted at: http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-core- home/patches/org.eclipse.jdt.core_2.1.0.zip *** This bug has been marked as a duplicate of 35128 *** |