Community
Participate
Working Groups
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
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.