Bug 297389 - [launch] Contextual launch mechanism can cause a lot of bundles to load
Summary: [launch] Contextual launch mechanism can cause a lot of bundles to load
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2009-12-09 14:59 EST by John Cortell CLA
Modified: 2019-11-04 23:16 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 John Cortell CLA 2009-12-09 14:59:36 EST
Extensions are touted as a lightweight means to contribute actions (e.g., menus and toolbar items) to the GUI without having to load the code that carries out those operations, instead lazy-loading the plugins when the action is actually invoked. For this reason I was surprised to see a plugin I'm working with get loaded when I move the cursor over the Debug toolbar button. Looking into it, I see that the loading is triggered by the launch shortcut support. Specifically, the debug platform is putting together the labels for the available launch shortcuts given the current selection (LaunchingResourceManager#computeLabels()). If contextual launching is turned on, it assembles the collection of LaunchShortcutExtension instances that are applicable for the current selection, then invokes logic that ultimately calls each ones LaunchShortcutExtension.getLaunchConfigurations(IEditorPart). This method requests the extension's delegate, which of course requires the bundle to load. 

If this activity operated on only a targeted set of shortcut extensions, then all this would not be THAT troubling. But what really concerns me is that we can end up with a fairly extensive set of shortcut extensions, even for a selection that they have nothing to do with. 

In the scenario I'm running, the selection is the CDT editor, yet the shortcuts identified for that selection are

   org.eclipse.cdt.debug.ui.localCShortcut
   org.eclipse.jdt.debug.ui.javaAppletShortcut
   org.eclipse.jdt.debug.ui.localJavaShortcut
   org.eclipse.jdt.junit.junitShortcut
   org.eclipse.pde.ui.junitWorkbenchShortcut
   org.eclipse.tm.tcf.debug.ui.TCFShortcut

The JDT and PDE ones don't seem to be a right match, but they end up in the list because, ironically enough, the plugins aren't loaded, and that screws up the extension enablement evaluation. To see this behavior, set a breakpoint in LaunchingResourceManager#computeLabels() and observe the result of calling

   getShortcutsForSelection(selection, group.getMode());

Thus, just hovering over the Debug toolbar button causes CDT, TCF, JDT and PDE plugins to load, even though the selection is the CDT editor. This just seems to go against the spirit of the lightweight GUI contribution mechanism in Eclipse.
Comment 1 Eclipse Genie CLA 2019-10-30 02:40:00 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.

--
The automated Eclipse Genie.
Comment 2 Sarika Sinha CLA 2019-11-04 23:16:27 EST
Not sure what can be done for this.