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

Bug 94047

Summary: [ActionSets] [classpath] Toolbar shudders when opening the Classpath Variables preference page
Product: [Eclipse Project] JDT Reporter: Brock Janiczak <brockj>
Component: DebugAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: daniel_megert, dirk_baeumer, Michael_Rennie
Version: 3.1   
Target Milestone: 4.4 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Brock Janiczak CLA 2005-05-08 03:48:06 EDT
Version: 3.1.0
Build id: I20050506-1600

When you open the Classpath Variables preference page from an empty workspace
(only minimal plugins activated) the toolbar shudders as if components are
quickly being added and removed.  The preference page is causing the activation
of quite a few plugins (Ant UI, JDT JUnit, JDT Launching, PDE and PDE core).  I
don't think any of these plugins contribute actions to the toolbar of my current
perspective (could be wrong though).
Comment 1 Nick Edgar CLA 2005-05-09 15:09:11 EDT
This is due to auto-building being turned off and back on (several times) by
JavaClasspathVariablesInitializer.initialize.

The stack is as follows.

Thread [main] (Suspended (breakpoint at line 1540 in WorkbenchActionBuilder))
	WorkbenchActionBuilder.updateBuildActions() line: 1540
	WorkbenchActionBuilder$2.propertyChange(Preferences$PropertyChangeEvent) line: 292
	Preferences$1.run() line: 497
	InternalPlatform.run(ISafeRunnable) line: 1031
	Platform.run(ISafeRunnable) line: 757
	PreferenceForwarder(Preferences).firePropertyChangeEvent(String, Object,
Object) line: 500
	PreferenceForwarder.setValue(String, boolean) line: 217
	WorkspacePreferences.setAutoBuilding(boolean) line: 147
	WorkspacePreferences.copyFromTo(WorkspaceDescription, WorkspaceDescription)
line: 70
	WorkspacePreferences.copyFrom(WorkspaceDescription) line: 116
	Workspace.setDescription(IWorkspaceDescription) line: 1786
	JavaClasspathVariablesInitializer.setAutobuild(IWorkspace, boolean) line: 103
	JavaClasspathVariablesInitializer.initialize(String) line: 78
	JavaCore.getClasspathVariable(String) line: 1426
	VariableBlock.refresh(String) line: 432
	VariableBlock.<init>(boolean, String) line: 109
	ClasspathVariablesPreferencePage.<init>() line: 44
	NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) line: not
available [native method]
	NativeConstructorAccessorImpl.newInstance(Object[]) line: 39
	DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 27
	Constructor.newInstance(Object[]) line: 274
	Class.newInstance0() line: 308
	Class.newInstance() line: 261
	ConfigurationElement.createExecutableExtension(Bundle, String, Object,
ConfigurationElement, String) line: 172
	ConfigurationElement.createExecutableExtension(String, String, Object,
ConfigurationElement, String) line: 152
	ConfigurationElement.createExecutableExtension(String) line: 139
	ConfigurationElementHandle.createExecutableExtension(String) line: 48
	WorkbenchPlugin.createExtension(IConfigurationElement, String) line: 225
	WorkbenchPreferenceNode.createPage() line: 46
	WorkbenchPreferenceDialog(PreferenceDialog).createPage(IPreferenceNode) line: 1203
	WorkbenchPreferenceDialog(FilteredPreferenceDialog).createPage(IPreferenceNode)
line: 237
	WorkbenchPreferenceDialog(PreferenceDialog).showPage(IPreferenceNode) line: 1102
	WorkbenchPreferenceDialog(FilteredPreferenceDialog).showPage(IPreferenceNode)
line: 352
	PreferenceDialog$8.selectionChanged(SelectionChangedEvent) line: 626
	StructuredViewer$3.run() line: 763
	InternalPlatform.run(ISafeRunnable) line: 1031
	Platform.run(ISafeRunnable) line: 757
	JFaceUtil$1.run(ISafeRunnable) line: 44
	SafeRunnable.run(ISafeRunnable) line: 148
	TreeViewer(StructuredViewer).firePostSelectionChanged(SelectionChangedEvent)
line: 761
	TreeViewer(StructuredViewer).handlePostSelect(SelectionEvent) line: 1033
	StructuredViewer$5.widgetSelected(SelectionEvent) line: 1053
	OpenStrategy.firePostSelectionEvent(SelectionEvent) line: 231
	OpenStrategy.access$4(OpenStrategy, SelectionEvent) line: 226
	OpenStrategy$3.run() line: 392
	RunnableLock.run() line: 35
	UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 118
	Display.runAsyncMessages(boolean) line: 2878
	Display.readAndDispatch() line: 2537
	WorkbenchPreferenceDialog(Window).runEventLoop(Shell) line: 803
	WorkbenchPreferenceDialog(Window).open() line: 781
	OpenPreferencesAction.run() line: 66
	OpenPreferencesAction(Action).runWithEvent(Event) line: 996
	ActionContributionItem.handleWidgetSelection(Event, boolean) line: 538
	ActionContributionItem.access$2(ActionContributionItem, Event, boolean) line: 488
	ActionContributionItem$5.handleEvent(Event) line: 400
	EventTable.sendEvent(Event) line: 82
	MenuItem(Widget).sendEvent(Event) line: 842
	Display.runDeferredEvents() line: 2901
	Display.readAndDispatch() line: 2534
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1601
	Workbench.runUI() line: 1565
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 315
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 143
	IDEApplication.run(Object) line: 103
	PlatformActivator$1.run(Object) line: 230
	EclipseStarter.run(Object) line: 345
	EclipseStarter.run(String[], Runnable) line: 158
	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: 324
	Main.invokeFramework(String[], URL[]) line: 328
	Main.basicRun(String[]) line: 272
	Main.run(String[]) line: 974
	Main.main(String[]) line: 950
Comment 2 Nick Edgar CLA 2005-05-09 15:26:32 EDT
I've made a change to WorkbenchActionBuilder which eliminates the flicker.
It now updates the toolbar to hide/show the autobuild button in an asyncExec.
It would previously only do this if the change was triggered by a background thread.
The initial case where the action bars are being populated is still done
synchronously.

Moving to JDT to comment on whether turning autobuild temporarily off if
necessary here.
Comment 3 Nick Edgar CLA 2005-05-09 16:51:41 EDT
s/if/is
Comment 4 Dirk Baeumer CLA 2005-05-09 17:42:14 EDT
Actually, this is launching...

Darin, can you please comment on why this is necessary
Comment 5 Darin Wright CLA 2005-05-09 17:57:36 EDT
The code to turn autobuild off/on has been there since day one. Looking at the 
code, I'm not sure why it is needed.
Comment 6 Kevin Barnes CLA 2005-05-20 14:44:19 EDT
deferred
Comment 7 Michael Rennie CLA 2008-10-28 12:48:22 EDT
reopen to set assigned
Comment 8 Michael Rennie CLA 2013-08-07 13:25:45 EDT
I''m not sure either why we bother to turn off autobuild repeatedly since the JavaModelOperation uses the AVOID_UPDATE flag to batch resource changes.

I removed the code here: https://git.eclipse.org/r/15216
Comment 9 Michael Rennie CLA 2013-08-12 15:26:40 EDT
(In reply to comment #8)
> I''m not sure either why we bother to turn off autobuild repeatedly since
> the JavaModelOperation uses the AVOID_UPDATE flag to batch resource changes.
> 
> I removed the code here: https://git.eclipse.org/r/15216

As I commented on the Gerrit review, I have been running this in my host Eclipse on Mac for the past few days and have no noticed any problems. 

The fix has been merged: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=670ee2ed44a51cfd5676c18968a45e9e86ad9bab