Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 255679 - BundleApiComponent resolve package name doesn't honor the external jars on the bundle classpath
Summary: BundleApiComponent resolve package name doesn't honor the external jars on th...
Status: RESOLVED WONTFIX
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE API Tools Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 253693
  Show dependency tree
 
Reported: 2008-11-18 11:57 EST by Olivier Thomann CLA
Modified: 2008-11-18 12:54 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 Olivier Thomann CLA 2008-11-18 11:57:53 EST
For the osgi bundle, the classpath contains two special jars through the bootclasspath properties inside the build.properties:

bootClasspath=osgi/exceptions.jar;osgi/xmlParserAPIs.jar;${CDC-1.1/Foundation-1.1}

These two jars provide types in java.nio packages as well as xml types.

When we resolve references to these types inside the osgi component, we return them as being found in the system library api component.
This is wrong for this bundle.

Inside org.eclipse.pde.api.tools.internal.model.ApiBaseline.resolvePackage(IApiComponent, String), we first check for system packages. We should first check the extra jars on the bundle classpath in the order they appear. In this case, the two jars appears before the system library entry.

Even if I remove that check, we don't resolve these entries against one of the two jars.

As long as this is not fixed, the new system api detection returns lots of false positives for this bundle.
Comment 1 Darin Wright CLA 2008-11-18 12:54:38 EST
The OSGi bundle is doing some compile/runtime trickery here... the extra bootclasspath entries in build.properties allow the bunlde to compile, but the classes may/may not be available at runtime. I beleive these are real illegal access errors that should be flagged, since the classes are not on the bundle's classpath.

The errors should be filtered by the bundle as known API problems. At runtime the classes do come from the system library, so our analysis is correct.