Bug 233568 - Type in Server Runtime is not resolved in editor
Summary: Type in Server Runtime is not resolved in editor
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-22 16:27 EDT by Andrew Mak CLA
Modified: 2008-08-06 13:58 EDT (History)
2 users (show)

See Also:


Attachments
Project to import (2.50 KB, image/zip)
2008-05-26 04:51 EDT, Jerome Lanneluc CLA
no flags Details
Proposed fix and regression tests (14.33 KB, patch)
2008-05-26 12:29 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Mak CLA 2008-05-22 16:27:45 EDT
I am working on an adopter product building on eclipse 3.4.  Here is the problem I'm running into;  I have a plain Java project to which I added a server runtime to the classpath.  Then in my source I reference a class that I know for sure is part of that server runtime, however, it shows as unresolvable.

Some interesting observations:

- I have to set the project's Java compliance level to 1.4 because the class I'm referencing has "enum" as a package name, so perhaps this has some effect on the error showing up.

- The error shows up only in the editor.  There are no error markers in package explorer or problems view.

- The class is "unresolvable" yet the editor can tell me that it is deprecated.  In open types dialog, the class is listed but when I try to open the type, an error says it cannot be found.

- If I copy the jar to my project and add it to the classpath directly, then the class can be resolved.

Please contact me directly for more information on how to reproduce this error.
Comment 1 Jerome Lanneluc CLA 2008-05-23 04:39:42 EDT
Asked Andrew to send me steps to reproduce and build id.
Comment 2 Jerome Lanneluc CLA 2008-05-26 04:51:28 EDT
Created attachment 101942 [details]
Project to import

After talking to Andrew, here are the minimal steps to reproduce
1. Build I20080523-0100
2. Start a new workspace on a 1.6 JRE
3. Import the attached project (there should be 2 errors in the Problems view)
4. Open Test.java in a Java editor
5. Open P's Properties, and change the Compiler compliance level to 1.4 (say Yes to rebuild)
Observe: The Java editor still reports an error (p.enum cannot be resolved) but the Problems view reports a warning only
Comment 3 Jerome Lanneluc CLA 2008-05-26 04:52:48 EDT
After restarting the workbench, the Java editor no longer reports the error (it reports the same warning as the Problems view)
Comment 4 Jerome Lanneluc CLA 2008-05-26 04:55:59 EDT
Problem existed in 3.3.2
Comment 5 Jerome Lanneluc CLA 2008-05-26 12:29:56 EDT
Created attachment 101999 [details]
Proposed fix and regression tests
Comment 6 Jerome Lanneluc CLA 2008-05-26 12:32:31 EDT
Since the problem is not a regression comparing to 3.3.2, since there is a workaround (see comment 3), and since we are at the RC3 stage, I will release this fix for 3.5 (and possibly backport it to 3.4.1) 
Comment 7 Jerome Lanneluc CLA 2008-06-24 06:13:49 EDT
Fix and test released for 3.5M1.

Since the chances of running into this bug are low and there is a workaround, I prefer to not take any risk and not release it in the 3.4 maintenance stream, unless there is a strong push for it.
Comment 8 Olivier Thomann CLA 2008-08-06 13:58:31 EDT
Verified for 3.5M1 using I20080805-1307