Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346982 - BundleRequirement/BundleCapability getAttributes/getDirectives must return all specified values
Summary: BundleRequirement/BundleCapability getAttributes/getDirectives must return al...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: Juno M1   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-24 09:13 EDT by Thomas Watson CLA
Modified: 2011-06-10 10:13 EDT (History)
2 users (show)

See Also:


Attachments
patch and tests (46.59 KB, patch)
2011-05-31 15:23 EDT, Thomas Watson CLA
no flags Details | Diff
Juno Patch (44.46 KB, patch)
2011-06-10 10:12 EDT, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Watson CLA 2011-05-24 09:13:34 EDT
The R4.3 Core Framework specification has had some late clarifications.  With the exception of BundleRequirement.getAttributes for the osgi.wiring.* name spaces (see bug346979), all specified bundle manifest attributes and all specified bundle manifest directives must be returned by BundleRequirement/BundleCapability getAttributes/getDirective methods.

This will require the following changes to Equinox.

1) For BundleCapability.getAttributes Equinox is already compliant with the specification.  All attributes specified in the headers are returned in the Map

2) For BundleCapability/BundleRequirement getDirectives methods Equinox currently only returns the specified directives that have semantic meaning.  All other specified directives are ignored.

3) For BundleRequirement getAttribute method Equinox currently returns an empty map for requirements specified by the Require-Capability header.  Instead Equinox needs to return all attributes, even though they have no semantic meaning.  The exception is that the osgi.wiring.* namespaces must have empty attributes map (see bug346979)

This fix may be too much for 3.7 to contain.
Comment 1 Thomas Watson CLA 2011-05-24 09:14:03 EDT
targeting 3.7.1 for now.
Comment 2 BJ Hargrave CLA 2011-05-24 10:25:14 EDT
We should start the 3.7.x maint branch to hold this fix. OSGi will need this fix for the Core 4.3 Framework RI.
Comment 3 Thomas Watson CLA 2011-05-24 10:42:26 EDT
(In reply to comment #2)
> We should start the 3.7.x maint branch to hold this fix. OSGi will need this
> fix for the Core 4.3 Framework RI.

Before branching, I would like to see how difficult the fix is.  If it is relatively simple perhaps we can consider for 3.7.
Comment 4 Thomas Watson CLA 2011-05-31 15:23:12 EDT
Created attachment 197034 [details]
patch and tests

This is quite an ugly thing to do.  In order to minimize the amount of change required and avoid any new API this fix adds arbitrary attrs and directives maps where necessary to store these useless/meaningless attributes and directives.  This allows us to avoid the extra Map for each and every (sometimes 10s of 1000s) capability and requirement in the system.
Comment 5 Thomas Watson CLA 2011-06-10 10:12:20 EDT
Created attachment 197783 [details]
Juno Patch

Here is an updated patch for HEAD.  The previous patch would be used for 3.7.1 if we decide to release it there.
Comment 6 Thomas Watson CLA 2011-06-10 10:13:49 EDT
Patch released for Juno M1.