Bug 6494 - New builder: Invalid error found (The declared package does not match the expected package)
Summary: New builder: Invalid error found (The declared package does not match the exp...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-02 18:04 EST by Jerome Lanneluc CLA
Modified: 2002-01-14 10:37 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2001-12-02 18:04:27 EST
Build 20011127 + latest JDT Core

1. Full build project org.eclipse.jdt.tests
2. Turn autobuild off
3. Add test method to JavaElementDeltaTests
4. Make change to JavaElementDeltaTests.suite()
5. Build
Observe: JavaModelRegressionTests and RunModelTests have the same error:
   "The declared package does not match the expected package"

Here is the trace of the builder:
INCREMENTAL build of: org.eclipse.jdt.core.tests
Compile this changed source file 
d:/eclipse/workspace/plugins/org.eclipse.jdt.core.tests/Eclipse Java Tests 
Model/src/org/eclipse/jdt/tests/core/JavaElementDeltaTests.java
About to compile 
d:/eclipse/workspace/plugins/org.eclipse.jdt.core.tests/Eclipse Java Tests 
Model/src/org/eclipse/jdt/tests/core/JavaElementDeltaTests.java
Writing class file JavaElementDeltaTests$1.class
Type has structural changes org/eclipse/jdt/tests/core/JavaElementDeltaTests
  adding dependents of JavaElementDeltaTests in org/eclipse/jdt/tests/core
Writing class file JavaElementDeltaTests.class
Writing class file JavaElementDeltaTests$2.class
  found match in org.eclipse.jdt.tests.core to JavaElementDeltaTests
  adding affected source file 
d:/eclipse/workspace/plugins/org.eclipse.jdt.core.tests/Eclipse Java Tests 
Model/src/org/eclipse/jdt/tests/core/JavaModelRegressionTests.java
About to compile 
d:/eclipse/workspace/plugins/org.eclipse.jdt.core.tests/Eclipse Java Tests 
Model/src/org/eclipse/jdt/tests/core/JavaModelRegressionTests.java
Type has structural changes org/eclipse/jdt/tests/core/JavaModelRegressionTests
  adding dependents of JavaModelRegressionTests in org/eclipse/jdt/tests/core
Writing class file JavaModelRegressionTests.class
  found match in org.eclipse.jdt.tests.core to JavaModelRegressionTests
  adding affected source file 
d:/eclipse/workspace/plugins/org.eclipse.jdt.core.tests/Eclipse Java Tests 
Runner/org/eclipse/jdt/core/tests/RunModelTests.java
About to compile 
d:/eclipse/workspace/plugins/org.eclipse.jdt.core.tests/Eclipse Java Tests 
Runner/org/eclipse/jdt/core/tests/RunModelTests.java
Writing class file RunModelTests.class
Comment 1 Jerome Lanneluc CLA 2001-12-02 18:10:39 EST
I have zipped my workspace if needed.
Comment 2 Philipe Mulet CLA 2001-12-03 07:38:21 EST
Reproduced with simpler workspace:

X.java---------------
package pack;
class X {
}

Y.java---------------
package pack;
class Y {
  X x;
}

=========
Then full build, and add one field to X.java, and request incremental build.
Y.java will be recompiled and tagged as having a package problem.

The recompilation loop miscomputes the expected package name: {{},
{ 'p','a','c','k' }} since it computed from the path '/pack/Y.java' instead of 
using 'pack/Y.java' as it did for the first one.

There seem to be inconsistencies in the path qualification (absolute/relative?).

Released a work-around at the point where computing the expected package name, 
but I think the problem is up-hill, and should only use consistent type 
locations.
Comment 3 Philipe Mulet CLA 2001-12-03 08:39:06 EST
Fixed