Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 385953 - [Contributions] HandlerProxy causes unnecessary plugin activation on shutdown
Summary: [Contributions] HandlerProxy causes unnecessary plugin activation on shutdown
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.8.1   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-25 11:04 EDT by Dani Megert CLA
Modified: 2012-08-16 04:10 EDT (History)
2 users (show)

See Also:
markus.kell.r: review+


Attachments
Fix (1.25 KB, patch)
2012-07-25 11:08 EDT, Dani Megert CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2012-07-25 11:04:38 EDT
3.8 and 4.2.

During shutdown, the handlers are deactivated. During that, HandlerProxy.isEnabled() gets called, which might cause plug-ins to be loaded:

Thread [main] (Suspended (breakpoint at line 259 in CompareUIPlugin))	
	CompareUIPlugin.start(BundleContext) line: 259	
	BundleContextImpl$1.run() line: 711	
	AccessController.doPrivileged(PrivilegedExceptionAction<T>) line: not available [native method]	
	BundleContextImpl.startActivator(BundleActivator) line: 702	
	BundleContextImpl.start() line: 683	
	BundleHost.startWorker(int) line: 381	
	BundleHost(AbstractBundle).start(int) line: 300	
	SecureAction.start(Bundle, int) line: 440	
	BundleLoader.setLazyTrigger() line: 263	
	EclipseLazyStarter.postFindLocalClass(String, Class, ClasspathManager) line: 107	
	ClasspathManager.findLocalClass(String) line: 469	
	DefaultClassLoader.findLocalClass(String) line: 216	
	BundleLoader.findLocalClass(String) line: 395	
	SingleSourcePackage.loadClass(String) line: 35	
	BundleLoader.findClassInternal(String, boolean, ClassLoader) line: 461	
	BundleLoader.findClass(String, boolean) line: 421	
	BundleLoader.findClass(String) line: 412	
	DefaultClassLoader.loadClass(String, boolean) line: 107	
	DefaultClassLoader(ClassLoader).loadClass(String) line: 247	
	Class<T>.getDeclaredConstructors0(boolean) line: not available [native method]	
	Class<T>.privateGetDeclaredConstructors(boolean) line: 2389	
	Class<T>.getConstructor0(Class[], int) line: 2699	
	Class<T>.newInstance0() line: 326	
	Class<T>.newInstance() line: 308	
	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	
	HandlerProxy.loadHandler() line: 350	
	HandlerProxy.isEnabled() line: 319	
	Command.isEnabled() line: 862	
	Command.setHandler(IHandler) line: 994	
	HandlerAuthority.updateCommand(String, IHandlerActivation) line: 457	
	HandlerAuthority.deactivateHandler(IHandlerActivation) line: 312	
	HandlerService.deactivateHandler(IHandlerActivation) line: 148	
	HandlerService.deactivateHandlers(Collection) line: 157	
	HandlerPersistence.clearActivations(IHandlerService) line: 104	
	HandlerPersistence.dispose() line: 125	
	HandlerService.dispose() line: 163	
	ServiceLocator.dispose() line: 142	
	Workbench.shutdown() line: 3057	
	Workbench.busyClose(boolean) line: 1123	
	Workbench.access$15(Workbench, boolean) line: 1040	
	Workbench$25.run() line: 1284	
	BusyIndicator.showWhile(Display, Runnable) line: 70	
	Workbench.close(int, boolean) line: 1282	
	Workbench.close() line: 1254	
	QuitHandler.execute(ExecutionEvent) line: 41	
	HandlerProxy.execute(ExecutionEvent) line: 293	
	Command.executeWithChecks(ExecutionEvent) line: 499	
	ParameterizedCommand.executeWithChecks(Object, Object) line: 508	
	HandlerService.executeCommand(ParameterizedCommand, Event) line: 169	
	SlaveHandlerService.executeCommand(ParameterizedCommand, Event) line: 241	
	ActionFactory$WorkbenchCommandAction(CommandAction).runWithEvent(Event) line: 157	
	ActionContributionItem.handleWidgetSelection(Event, boolean) line: 584	
	ActionContributionItem.access$2(ActionContributionItem, Event, boolean) line: 501	
	ActionContributionItem$5.handleEvent(Event) line: 411	
	EventTable.sendEvent(Event) line: 84	
	MenuItem(Widget).sendEvent(Event) line: 1053	
	Display.runDeferredEvents() line: 4169	
	Display.readAndDispatch() line: 3758	
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2701	
	Workbench.runUI() line: 2665	
	Workbench.access$4(Workbench) line: 2499	
	Workbench$7.run() line: 679	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 668	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149	
	IDEApplication.start(IApplicationContext) line: 124	
	EclipseAppHandle.run(Object) line: 196	
	EclipseAppLauncher.runApplication(Object) line: 110	
	EclipseAppLauncher.start(Object) line: 79	
	EclipseStarter.run(Object) line: 353	
	EclipseStarter.run(String[], Runnable) line: 180	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	Main.invokeFramework(String[], URL[]) line: 629	
	Main.basicRun(String[]) line: 584	
	Main.run(String[]) line: 1438	
	Main.main(String[]) line: 1414
Comment 1 Dani Megert CLA 2012-07-25 11:08:53 EDT
Created attachment 219167 [details]
Fix
Comment 2 Markus Keller CLA 2012-07-30 12:45:56 EDT
The patch looks OK, but I couldn't find a scenario where the Compare plug-in was only loaded on shut-down. Do you have an example?
Comment 3 Dani Megert CLA 2012-07-31 08:04:26 EDT
(In reply to comment #2)
> The patch looks OK, but I couldn't find a scenario where the Compare plug-in
> was only loaded on shut-down. Do you have an example?

1. get latest EGit (important)
2. start new workspace
3. add a project
   ==> loads EGit due to decorator
4. exit
   ==> loads Compare UI
Comment 4 Markus Keller CLA 2012-07-31 09:27:44 EDT
Patch is good and solves the problem. OK for 3.8.1 and 4.2.1/4.3
Comment 6 Dani Megert CLA 2012-08-16 04:10:43 EDT
Verified in M20120815-1000 and M20120815-1200.