Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 176289 - Multiple bundle versions in workspace does not work.
Summary: Multiple bundle versions in workspace does not work.
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Wassim Melhem CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-03 10:38 EST by Thomas Watson CLA
Modified: 2007-03-23 09:49 EDT (History)
0 users

See Also:


Attachments
example projects (13.25 KB, application/octet-stream)
2007-03-03 10:56 EST, Thomas Watson CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Watson CLA 2007-03-03 10:38:01 EST
Build id: I20070228-0930

I will attach example projects with steps to reproduce.
Comment 1 Thomas Watson CLA 2007-03-03 10:56:03 EST
Created attachment 60222 [details]
example projects

This zip contains four projects.

org.eclipse.example.core_1.0.0
org.eclipse.example.core_1.1.0
org.eclipse.example.rcp
org.eclipse.example.ui

The org.eclipse.example.core projects contain two versions (1.0.0 and 1.1.0) of the org.eclipse.example.core bundle.  Each export a different version of the package org.eclipse.example.core (1.0.0 and 1.1.0 respectively).  Both the org.eclipse.example.ui and org.eclipse.example.rcp import the org.eclipse.example.core package.  The following steps will result in unexpected behavior

1) Load the projects into an empty workspace.  Notice that everything seems to resolve and compile fine.  Both importing bundles get wired to the highest possible version of the org.eclipse.example.core 1.1.0 and the appropriate 1.1.0 version of that project is added to the classpath of each importer

2) Change the import for the org.eclipse.example.ui to the following to scope down the range and save the manifest:
Import-Package: org.eclipse.example.core;version="[1.0.0,1.1.0)"

3) Notice that the classpath for the org.eclipse.example.ui project does not change, it still references org.eclipse.example.core_1.1.0 projet even though that project does not export the proper version of the package.

Expected results:
Both projects org.eclipse.example.rcp and org.eclipse.example.ui should reference org.eclipse.example.core_1.0.0 project.  This is because org.eclipse.example.ui has a "uses" clause that restricts the valid packages that importers of org.eclipse.example.ui packgae can be wired to.

Now if you close org.eclipse.example.core_1.1.0 you would think things would clear up and force the bundles to use org.eclipse.example.core_1.0.0, but it gets more confusing.  I see this build path error then:

Severity and Description	Path	Resource	Location	Creation Time	Id
Project 'org.eclipse.example.rcp' is missing required Java project: 'org.eclipse.example.core_1.1.0'		org.eclipse.example.rcp	Build path	1172937026366	161
Comment 2 Thomas Watson CLA 2007-03-03 11:00:01 EST
More information:  I debugged the resolver because I feared a resolver bug at first ;-)   But the resolver seems to be working just fine.  When I traced through it was correctly resolving to the org.eclipse.example.core_1.0.0 project, but PDE did not seem to recognize this correctly.  I think PDE does not really handle multiple bundle version mappings correctly.
Comment 3 Wassim Melhem CLA 2007-03-20 01:56:40 EDT
need to iron out classpath issues for M6
Comment 4 Wassim Melhem CLA 2007-03-22 04:46:05 EDT
fixed and now works exactly as per comment 1.
Comment 5 Thomas Watson CLA 2007-03-23 09:49:52 EDT
Verified on  I20070322-0950

I filed another related bug 178857 when using require-bundle.