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

Bug 361562

Summary: [Compatibility] Debug actions in the global debug toolbar are enabled prematurely
Product: [Eclipse Project] Platform Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Paul Webster <pwebster>
Severity: normal    
Priority: P3 CC: daniel_megert, malaperle, pawel.1.piech, swsivara, yevshif
Version: 4.2   
Target Milestone: 4.2 M6   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 331444    
Attachments:
Description Flags
ActionDelegateHandlerProxy patch v1 none

Description Remy Suen CLA 2011-10-20 11:32:22 EDT
The actions in the global debug toolbar are enabled on startup. If you click on them, they become disabled. They start off as being disabled in 3.
Comment 1 Remy Suen CLA 2012-02-08 11:10:40 EST
*** Bug 370592 has been marked as a duplicate of this bug. ***
Comment 2 Remy Suen CLA 2012-02-08 11:11:02 EST
Also affects CDT. See bug 370592 comment 0.
Comment 3 Remy Suen CLA 2012-02-08 11:19:43 EST
We eagerly instantiate actions in 3.x if their parent bundle is active so this isn't a problem in 3.x.

Thread [main] (Suspended (breakpoint at line 22 in SuspendCommandActionDelegate))
	SuspendCommandActionDelegate.<init>() line: 22	
	J9VMInternals.newInstanceImpl(Class) line: not available [native method]	
	Class<T>.newInstance() line: 1375	
	EquinoxRegistryStrategy(RegistryStrategyOSGI).createExecutableExtension(RegistryContributor, String, String) line: 184	
	ExtensionRegistry.createExecutableExtension(RegistryContributor, String, String) line: 905	
	ConfigurationElement.createExecutableExtension(String) line: 243	
	ConfigurationElementHandle.createExecutableExtension(String) line: 55	
	WorkbenchPlugin.createExtension(IConfigurationElement, String) line: 260	
	WWinPluginAction(PluginAction).createDelegate() line: 122	
	WWinPluginAction(PluginAction).selectionChanged(ISelection) line: 275	
	WWinPluginAction.refreshSelection() line: 275	
	WWinPluginAction.<init>(IConfigurationElement, IWorkbenchWindow, String, int) line: 121	
	ActionDescriptor.createAction(int, IConfigurationElement, Object, String) line: 265	
	ActionDescriptor.<init>(IConfigurationElement, int, Object) line: 176	
	PluginActionSetBuilder.createActionDescriptor(IConfigurationElement) line: 141	
	PluginActionSetBuilder(PluginActionBuilder).readElement(IConfigurationElement) line: 161	
	PluginActionSetBuilder(RegistryReader).readElements(IConfigurationElement[]) line: 144	
	PluginActionSetBuilder(RegistryReader).readElementChildren(IConfigurationElement) line: 133	
	PluginActionSetBuilder(PluginActionBuilder).readElement(IConfigurationElement) line: 144	
	PluginActionSetBuilder(RegistryReader).readElements(IConfigurationElement[]) line: 144	
	PluginActionSetBuilder.readActionExtensions(PluginActionSet, IWorkbenchWindow) line: 268	
	PluginActionSetBuilder.processActionSets(ArrayList, WorkbenchWindow) line: 230	
	ActionPresentation.setActionSets(IActionSetDescriptor[]) line: 184	
	WorkbenchWindow.updateActionSets() line: 3299	
	WorkbenchWindow$28.run() line: 3050	
	BusyIndicator.showWhile(Display, Runnable) line: 70	
	WorkbenchWindow.setActivePage(IWorkbenchPage) line: 3011	
	WorkbenchWindow$21.runWithException() line: 2297	
	WorkbenchWindow$21(StartupThreading$StartupRunnable).run() line: 31	
	RunnableLock.run() line: 35	
	UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 135	
	Display.runAsyncMessages(boolean) line: 4140	
	Display.readAndDispatch() line: 3757	
	IDEWorkbenchAdvisor(WorkbenchAdvisor).openWindows() line: 803	
	Workbench$33.runWithException() line: 1600	
	Workbench$33(StartupThreading$StartupRunnable).run() line: 31	
	RunnableLock.run() line: 35	
	UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 135	
	Display.runAsyncMessages(boolean) line: 4140	
	Display.readAndDispatch() line: 3757	
	Workbench.runUI() line: 2609
Comment 4 Remy Suen CLA 2012-02-08 13:16:10 EST
Created attachment 210749 [details]
ActionDelegateHandlerProxy patch v1

If we initiate the delegate when doing enablement checks we can get around this problem. A BundleListener would also work if we wanted to go down that route.
Comment 5 Remy Suen CLA 2012-02-08 16:27:18 EST
(In reply to comment #4)
> Created attachment 210749 [details]
> ActionDelegateHandlerProxy patch v1

Fix pushed to master.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=b6d2d2517fd8f8c04bc8698237fed677b7b64222
Comment 6 Remy Suen CLA 2012-02-10 09:27:31 EST
*** Bug 371130 has been marked as a duplicate of this bug. ***
Comment 7 Remy Suen CLA 2012-02-10 09:27:35 EST
*** Bug 371131 has been marked as a duplicate of this bug. ***
Comment 8 Remy Suen CLA 2012-02-10 09:27:59 EST
Reverted. The change caused many casualties. See bug 371130 and bug 371131.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=c177e74208e0316544dbfb12a3ec8287462f9eec
Comment 9 Remy Suen CLA 2012-02-27 09:19:56 EST
(In reply to comment #8)
> Reverted. The change caused many casualties. See bug 371130 and bug 371131.
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=c177e74208e0316544dbfb12a3ec8287462f9eec

Bug 371131 has been fixed now, so I've pushed the change back up to master. Bug 371130 is a problem with or without the change.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=b6abe9cf8a95bf3bec07d0d3c34de8d4b521a3b0
Comment 10 Dani Megert CLA 2012-03-13 06:50:51 EDT
Verified in 4.2-I20120312-1730.
Comment 11 Swetha CLA 2013-04-29 05:09:51 EDT
We are using 

Eclipse Platform

Version: 4.2.1.v20130118-173121-9MF7GHYdG0B5kx4E_SkfZV-1mNjVATf67ZAb7
Build id: M20130204-1200

and this issue is seen again.
Comment 12 Dani Megert CLA 2013-04-29 06:12:07 EDT
(In reply to comment #11)
> We are using 
> 
> Eclipse Platform
> 
> Version: 4.2.1.v20130118-173121-9MF7GHYdG0B5kx4E_SkfZV-1mNjVATf67ZAb7
> Build id: M20130204-1200
> 
> and this issue is seen again.

Please open a new bug with steps to reproduce based on
http://download.eclipse.org/eclipse/downloads/drops4/I20130428-2000/