Bug 88351 - Compiler dependency problem in 2.1.3 & the latest 3.0.2 build
Summary: Compiler dependency problem in 2.1.3 & the latest 3.0.2 build
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows 2000
: P3 normal with 2 votes (vote)
Target Milestone: 3.1.2   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-17 12:13 EST by Troy Bishop CLA
Modified: 2007-03-30 14:58 EDT (History)
4 users (show)

See Also:


Attachments
The project files necessary to reproduce this problem. (4.21 KB, application/zip)
2005-03-17 12:53 EST, Troy Bishop CLA
no flags Details
The modified projects (4.05 KB, application/x-zip-compressed)
2005-04-28 10:59 EDT, Svetoslav Rusev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Troy Bishop CLA 2005-03-17 12:13:17 EST
The following compiler dependency error exists in both Eclipse v2.1.3 and the
lastest Eclipse v3.0.2 build (as of yesterday).  It seems to be resolved in the
Eclipse v3.1M5a build.

Create the following projects & dependencies:

Child.java (in project A):
public class Child extends Parent implements Intf {
 public void foo() {
  System.out.println("foo in Child");
 }
}

Parent.java (in project 1B)

public class Parent {
 public static void main(String[] args) {
 }
}

Intf.java (in project 1C)
public interface Intf {
 void foo();
}

Test.java (in project 1D)

public class Test {
 public static void main(String[] args) {
  Child child = new Child();
  child.foo();
 }
}

Project Dependencies
A: 1B, 1C
1B: 1C
1D: A, 1B

This set of dependency definitions (the equivalent classpath) works for javac
and ant, but the Eclipse compiler gives the following error when attempting to
build Project 1D.

Kind Status Priority Description Resource In Folder Location
Error   The project was not built since its classpath is incomplete. Cannot find
the class file for Intf. Fix the classpath then try rebuilding this project. 1D
Error   This compilation unit indirectly references the missing type Intf
(typically some required class file is referencing a type outside the classpath)
Test.java 1D line 0

The work-around for this problem is to export '1C' from the Java Build Path of
project 'A' however I've been told that it is not an acceptable work-around. 
Would it be possible to fix this problem in both 2.1.3 and 3.0.2?  I will attach
a ZIP file containing all 4 projects so that you can import them and reproduce.
Thank you
Comment 1 Troy Bishop CLA 2005-03-17 12:53:06 EST
Created attachment 18902 [details]
The project files necessary to reproduce this problem.
Comment 2 Troy Bishop CLA 2005-03-17 16:12:28 EST
Note: You will need to remove the '1C' dependency on project '1D' to reproduce
the problem if you reconstruct this scenario using the projects given in the
attached projects.zip file.
Comment 3 Philipe Mulet CLA 2005-03-18 04:23:14 EST
This is an area which is not spec'ed in JLS; i.e. how much a compiler needs on
its classpath to perform is up to its implementation.
In 3.1 stream, we reduced the need for some required types, but this cannot
easily be backported since it relies on quite a lot of changes in our namelookup
algorithm.
Comment 4 Philipe Mulet CLA 2005-03-18 04:55:10 EST
To reproduce, need to remove 1C from 1D classpath.
Comment 5 Philipe Mulet CLA 2005-04-03 06:08:52 EDT
Bug 36397 is the one we addressed in 3.1 stream, and made problem go away there.
Investigating backporting it to 3.0 maintenance stream. This is a BIG change
considering a maintenance stream.
Comment 6 Philipe Mulet CLA 2005-04-03 06:12:35 EDT
At least 14 classes are touched by this change.
Comment 7 Philipe Mulet CLA 2005-04-03 06:15:23 EDT
Kent - I released changes to branch 3.0 maintenance. Pls double check them. It
passes all tests, including NegativeTest#test424-425 modified as along the lines
of 3.1 stream to demonstrate increased laziness.

Comment 8 Svetoslav Rusev CLA 2005-04-21 06:23:49 EDT
(In reply to comment #7)
> Kent - I released changes to branch 3.0 maintenance. Pls double check them. It
> passes all tests, including NegativeTest#test424-425 modified as along the 
lines
> of 3.1 stream to demonstrate increased laziness.

Can you please specify in which Eclipse 3.0 branch is the fix, because I have 
taken the Maintenance Build: M20050113 and there the problem still exists.
Comment 9 Philipe Mulet CLA 2005-04-21 07:37:02 EDT
This hasn't made it publicly out yet in any integration build.
You may get the fix, it is released in branch "R3_0_maintenance".
Comment 10 Svetoslav Rusev CLA 2005-04-21 10:41:05 EDT
Is there a patch for this problem which can be used for Eclipse 3.0 final 
release.
A plugin or set of plugins which can be replaced
and the Compiler dependency problem to be resolved. I have Check out the 
R3_0_maintenance branch of the project org.eclipse.jdt.core but the 
project "org.eclipse.jdt.core" can't be compiled with target platform of 
Eclipse 3.0.

Svetoslav
Comment 11 Philipe Mulet CLA 2005-04-21 15:48:53 EDT
That should just work. Note that you may want a 3.0.2 release instead, since it
has couple fixes which got issued since 3.0; but API wise there should be no
difference, so you should be able to build it against either 3.0 or 3.0.2.
Comment 12 Svetoslav Rusev CLA 2005-04-22 04:00:05 EDT
It does not compile neither with 3.0 nor 3.0.2. It cannot find class
org.eclipse.core.runtime.PerformanceStats, 
org.eclipse.core.resources.ResourceAttributes
and also class org.eclipse.osgi.util.NLS. that was the R3_0_maintenance branch 
from 21.04.2005. org.eclipse.jdt.core - the subproject "model" does not compile 
only.

Comment 13 Philipe Mulet CLA 2005-04-22 17:25:40 EDT
It does compile just fine for me. Your setup must be wrong somehow. Please
provide exact steps to reproduce.
Comment 14 Svetoslav Rusev CLA 2005-04-28 03:36:07 EDT
I have taken the head branch instead of R3_0_maintenance, now it compiles with 
target Platform 3.0.2 and 3.0 and works as desired. If we replace only this 
plugin in the Maintance build from 13 Jan 2005 or with Eclipse 3.0 from 25 Jun 
2004 will it be stable and work without any problems?
Comment 15 Philipe Mulet CLA 2005-04-28 04:03:50 EDT
HEAD is corresponding to 3.1 development stream, and has tons of changes you do
not want in a maintenance branch, since too risky. Additionnally, there is no
guarantee some internal signature did change, and some downstream components
would need to be recalibrated to match our 3.1 stream (i.e. you need their 3.1
counterpart).

So it is far preferrable to build a true 3.0 update, rather than pluging some
3.1 pieces into 3.0 platform. I still do not get why you cannot manage to build
a 3.0 update; it shouldn't be any different from building a 3.1 update.
Can you describe precisely what you tried ?
Comment 16 Svetoslav Rusev CLA 2005-04-28 07:16:36 EDT
Sorry, maybe in my last post I was not clear enough.
When I was unable to build the plugin org.eclipse.jdt.core it was because I 
have taken the HEAD branch instead of R3_0_maintenance branch. Now when I took 
the R3_0_maintenance branch it was bild successfully with target platform 3.0 
and 3.0.2.
My question is can we just replace the org.eclipse.jdt.core plugin ver.3.0.0 
from Eclipse 3.0 with org.eclipse.jdt.core plugin ver.3.0.2 from maintenance 
branch and Eclipse 3.0 to continue to be stable and work good? Is there any 
majour changes in ver. 3.0.2 for this plugin since 3.0?
Comment 17 Philipe Mulet CLA 2005-04-28 09:02:12 EDT
Oh, then you should be fine. The best would be for you to patch a 3.0.2 official
release with what you created; if not then I suspect there could be issues
resulting from plugin version numbers, in which case you'd have to edit the
plugin.xml and change version ID from 3.0.2 to 3.0.0 if you intend to patch a
3.0.0 official release.
No major change occurs in maintenance deliveries, so this should just work.
Comment 18 Svetoslav Rusev CLA 2005-04-28 10:59:47 EDT
Created attachment 20461 [details]
The modified projects

The modified projects
Comment 19 Svetoslav Rusev CLA 2005-04-28 11:00:39 EDT
There is still one problem existing which doesn't appear in Eclipse 3.1 and 
javac compiler. The scenario is as the original one provided from the Reporter 
of this bug and only one change must be made to be achieved. In the class 
Parent.java create new method :

public Object getTest(){
    return null;
}
call this method after the calling of child.foo(); in Test.java
The following error is given:
The project was not built since its build path is incomplete. Cannot find the 
class file for Intf. Fix the build path then try building this project.
The type Intf cannot be resolved. It is indirectly referenced from 
required .class files

The problem does not appear in Eclipse 3.1.

Please, fix this also, for now when you call the methods from the interface 
there is no problem - before the fix there was problems with it also.	

I'm applying the modified projects also as an attachment

Comment 20 Philipe Mulet CLA 2005-08-18 18:48:17 EDT
Kent - can you pls look at the last issue, there seems to be steps to reproduce.
Comment 21 Kent Johnson CLA 2007-03-30 14:58:32 EDT
This one slipped thru the cracks.

I tried the testcase from comment #18 and it works fine in 3.3M6, 3.2.2 and 3.1.2