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

Bug 423768

Summary: [CSS] IAE exception when switching between CSS stylesheets with combo
Product: [Eclipse Project] Platform Reporter: Daniel Rolka <daniel.rolka>
Component: UIAssignee: Daniel Rolka <daniel.rolka>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P3    
Version: 4.4   
Target Milestone: 4.4 M4   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 423704    
Attachments:
Description Flags
The CSS stylesheet that enables the CSS bridge none

Description Daniel Rolka CLA 2013-12-11 02:42:28 EST
Created attachment 238234 [details]
The CSS stylesheet that enables the CSS bridge

Steps to reproduce the issue:

1) Enable the CSS bridge functionality by using the CSS stylesheet attached to the bug
2) Start the Eclipse, open the ColorAndFontPreferencePage dialog (Window->Preferences->Colors and Fonts) and do some changes in the 3.x theme. Close dialog
3) Open the ViewsPreferencePage dialog (Window->Preferences->Appearance) and start to switch between CSS stylesheets. Switch between those that use the Font/Color definitions and others that don't use it
4) After applying the new change and closing the 'Restart is required for the theme change to take full effect' message box you will get the IllegalArgumentException (Argument not valid -> SWT.ERROR_GRAPHIC_DISPOSED):

java.lang.IllegalArgumentException: Argument not valid
	at org.eclipse.swt.SWT.error(SWT.java:4400)
	at org.eclipse.swt.SWT.error(SWT.java:4334)
	at org.eclipse.swt.SWT.error(SWT.java:4305)
	at org.eclipse.swt.graphics.GC.setFont(GC.java:4403)
	at org.eclipse.swt.custom.CTabFolder.onPaint(CTabFolder.java:1981)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:289)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4351)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070)
	at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5014)
	at org.eclipse.swt.internal.win32.OS.RedrawWindow(Native Method)
	at org.eclipse.swt.widgets.Control.update(Control.java:4436)
	at org.eclipse.swt.widgets.Display.update(Display.java:4875)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:834)
Comment 1 Daniel Rolka CLA 2013-12-11 02:43:14 EST
Found in the build: I20131209-2000
Comment 2 Daniel Rolka CLA 2013-12-11 03:02:44 EST
The workaround for the issue is restarting the Eclipse after modifying the 3.x theme with the 'Window->Preferences->Colors and Fonts' preference page and before switching to other CSS stylesheet with the 'Window->Preferences->Appearance' one.

Probably the issue here is caused by the out-of-synchronization stylesheets and partial applying the new CSS stylesheet (after switching the CSS theme the user has to restart the Eclipse to get full effect) so maybe synchronizing it would be another workaround for it. I haven't checked it

Daniel
Comment 3 Daniel Rolka CLA 2013-12-11 05:38:50 EST
Gerrit review link: https://git.eclipse.org/r/#/c/19633/

Daniel
Comment 4 Paul Webster CLA 2013-12-11 10:26:52 EST
This IAE renders the workbench unusable

PW
Comment 5 Paul Webster CLA 2013-12-11 11:25:53 EST
I've released the fix as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=05044a55787792abee37f4adaef63c63198bbae5

Now the user will get the popup "must restart eclipse" and the CTabFolders won't be hosed.

We need to overhaul the CSS engine approach to resource management in bug 423813

PW
Comment 6 Daniel Rolka CLA 2013-12-12 09:05:32 EST
Verified in the build: I20131211-2000

Daniel