Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332650

Summary: Bundle find hook should govern BundleContext.getBundle(id)
Product: [Eclipse Project] Equinox Reporter: Glyn Normington <glyn.normington>
Component: FrameworkAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tjwatson
Version: 3.6.1   
Target Milestone: 3.7 M5   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 330776    
Attachments:
Description Flags
patch none

Description Glyn Normington CLA 2010-12-15 11:02:13 EST
The javadoc for the find book says BundleContext.getBundle(id) *is* governed by the find hook.
Comment 1 Thomas Watson CLA 2010-12-15 15:33:49 EST
Created attachment 185265 [details]
patch

This patch fixes the issue.  The actual behavior is a simple fix.  But the ramifications ended up being a bit tricky.  There was quite a few places in the framework that assumed the system BundleContext.getBundle(id) would return a bundle object without any chance of a find hook filtering it out.

This patch fixes all places in the framework that called BC.getBundle(id) except for the framework console commands and the composite support.  Eventually the composite support will go away.  The framework console support we want to allow filtering.

I still have a bit of code that makes the system bundle context special WRT to BC.getBundle(id).  My fear is that equinox framework hook implementations may be depending on the same behavior.  I don't want to all of a sudden break them.
Comment 2 Thomas Watson CLA 2010-12-15 15:35:21 EST
Patch released.