Bug 227724 - Allow to reuse bundles outside of OSGi
Summary: Allow to reuse bundles outside of OSGi
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-18 04:50 EDT by Aaron Digulla CLA
Modified: 2019-09-06 16:11 EDT (History)
1 user (show)

See Also:


Attachments
Example for fixed Plugin class (31.73 KB, text/plain)
2008-04-18 04:50 EDT, Aaron Digulla CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Digulla CLA 2008-04-18 04:50:36 EDT
Created attachment 96570 [details]
Example for fixed Plugin class

Right now, OSGi code is riddled with "final" and "private static" elements which make it unnecessary hard to reuse bundles (plug-ins) without an OSGi environment.

For example, for tests, I'd like to be able to create individuals bundles without firing up the whole OSGi framework all the time. 

Key issues I've already identified:

1. Constructors are package private and instances are stored in "private static" fields. Examples: CommonPlugin, RichTextPlugin (EPF)

2. Many methods in org.eclipse.core.runtime.Plugin are final, making it impossible to setup a minimal runtime for tests. Examples: getLog(), find(), getBundle(), getPluginPreferences(), getStateLocation()

3. Often, lock-in code like "InternalPlatform.getDefault()" is spread all over the place instead of having it in a single, overridable place where tests could inject a mock object.

4. Fields are initialized in static code blocks using lock-in code as in point #3 making it impossible to override the defaults, usually in conjunction with #1
Comment 1 Eclipse Webmaster CLA 2019-09-06 16:11:34 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.