Bug 133321 - Compiler errors after analyzing code and adding dependencies
Summary: Compiler errors after analyzing code and adding dependencies
Status: RESOLVED DUPLICATE of bug 73957
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Brian Bauman CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-27 02:55 EST by Wassim Melhem CLA
Modified: 2006-03-29 15:01 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wassim Melhem CLA 2006-03-27 02:55:16 EST
Latest pde.core and pde.ui from head

1. Fresh workspace
2. Create a new plug-in project with an Activator that uses a UI, but without a template
3. On the Dependencies tab of the plugin editor, remove core.runtime and org.eclipse.ui from the Require-Bundle section and add them to the 'Automated Management of Dependencies' section.
4. Save.  All is well.
5. in the automated management section, choose to add dependencies to the manifest.mf via "Import-Package"

The operation adds the org.eclipse.ui.plugin and org.osgi.framework packages.

This is fine.

however, this results in compiler errors complaining that Plugin (superclass of AbstractUIPlugin) is not on the classpath.

Tom, should PDE have added the package contributing Plugin to the Import-Package list?  or is the list fine but the Import-Package usage is going to expose bug 73957 a lot more frequently than we hope?
Comment 1 Wassim Melhem CLA 2006-03-27 03:11:43 EST
Note that the errors appear after you remove the bundles from the secondary dependency list and save.
Comment 2 Thomas Watson CLA 2006-03-27 11:24:53 EST
This actually will work at runtime if you leave the secondary dependencies so that you can compile successfully.  I think this is related to JDT being too strict for our comfort.  See bug 122915 for more information.  I would not recommend PDE start adding more imports that what is needed at runtime here.  That will only cause different defects to be opened for you.
Comment 3 Wassim Melhem CLA 2006-03-27 11:31:53 EST
Thanks Tom.  this is then a dup of bug 73957 where the compiler needs more stuff on the classpath than the runtime.

*** This bug has been marked as a duplicate of 73957 ***
Comment 4 Jeff McAffer CLA 2006-03-29 14:49:30 EST
but does this mean that the UI should be reexporting runtime?  In the past we have said that if you expose someone else's API on your API then you should rexport to ensure that your consumers get the same one as you got.  Presumably this would solve the problem here and be somewhat more accurate
Comment 5 Wassim Melhem CLA 2006-03-29 14:54:15 EST
Reexporting a dependency plays no role in this strictly Import-Package-oriented scenario, does it?
Comment 6 Jeff McAffer CLA 2006-03-29 15:00:40 EST
d'oh I missed that part.  Never mind...
Comment 7 Wassim Melhem CLA 2006-03-29 15:01:58 EST
This issue is a big problem though.  bug 73957 is pretty controversial.