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

Bug 324258

Summary: [Forms] IllegalArgumentException when trying to expend Attributes in Task Editor
Product: [Eclipse Project] Platform Reporter: Yufen Kuo <ykuo>
Component: User AssistanceAssignee: Chris Goldthorpe <cgold>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cgold, eclipse.felipe, remy.suen, robert.elves, steffen.pingel
Version: 3.6   
Target Milestone: 3.7 M6   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
snippet to reproduce bug
none
Patch none

Description Yufen Kuo CLA 2010-09-01 19:15:23 EDT
Build Identifier: I20100608-0911

When trying to expend the "Attributes" section in Task Editor, receiving IllegalArgumentException and no attributes were displayed in the editor.

below is the stack trace:
java.lang.IllegalArgumentException: Argument not valid
at org.eclipse.swt.SWT.error(SWT.java:4064)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.SWT.error(SWT.java:3969)
at org.eclipse.swt.graphics.GC.setFont(GC.java:3351)
at org.eclipse.ui.forms.widgets.ExpandableComposite$ExpandableLayout.layout(ExpandableComposite.java:307)
at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1546)
at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1360)
at org.eclipse.swt.widgets.Canvas.setBounds(Canvas.java:333)
at org.eclipse.swt.widgets.Control.setBounds(Control.java:735)
at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:689)
at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:193)
at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1546)
at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1360)
at org.eclipse.swt.widgets.Control.setBounds(Control.java:735)
at org.eclipse.ui.forms.widgets.SizeCache.setBounds(SizeCache.java:509)
at org.eclipse.ui.forms.widgets.Form$FormLayout.layout(Form.java:159)
at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1546)
at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1360)
at org.eclipse.swt.widgets.Control.setBounds(Control.java:707)
at org.eclipse.swt.custom.ScrolledCompositeLayout.layout(ScrolledCompositeLayout.java:109)
at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1546)
at org.eclipse.swt.widgets.Composite.layout(Composite.java:951)
at org.eclipse.swt.widgets.Composite.layout(Composite.java:909)
at org.eclipse.ui.forms.widgets.SharedScrolledComposite.layout(SharedScrolledComposite.java:146)
at org.eclipse.ui.forms.widgets.SharedScrolledComposite.reflow(SharedScrolledComposite.java:215)
at org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage.reflow(AbstractTaskEditorPage.java:1345)
at org.eclipse.mylyn.internal.tasks.ui.editors.AbstractTaskEditorSection$1.expansionStateChanged(AbstractTaskEditorSection.java:66)
at org.eclipse.ui.forms.widgets.ExpandableComposite.fireExpanding(ExpandableComposite.java:1068)
at org.eclipse.ui.forms.widgets.ExpandableComposite.toggleState(ExpandableComposite.java:1052)
at org.eclipse.ui.forms.widgets.ExpandableComposite.access$5(ExpandableComposite.java:1048)
at org.eclipse.ui.forms.widgets.ExpandableComposite$2.linkActivated(ExpandableComposite.java:571)
at org.eclipse.ui.forms.widgets.AbstractHyperlink.handleActivate(AbstractHyperlink.java:233)
at org.eclipse.ui.forms.widgets.AbstractHyperlink.handleMouseUp(AbstractHyperlink.java:327)
at org.eclipse.ui.forms.widgets.AbstractHyperlink.access$2(AbstractHyperlink.java:311)
at org.eclipse.ui.forms.widgets.AbstractHyperlink$4.handleEvent(AbstractHyperlink.java:125)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3552)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3171)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)


Reproducible: Always

Steps to Reproduce:
1.Open a task in task editor (task is from Bugzillia task repository)
2.Click on Attributes section
3.nothing got expended and received unhandled event loop exception
Comment 1 Steffen Pingel CLA 2010-09-01 19:44:55 EDT
Moving to platform since Mylyn does not do anything special with the font of the section. What Eclipse version and operating system are you using?
Comment 2 Yufen Kuo CLA 2010-09-01 19:48:58 EDT
(In reply to comment #1)
> Moving to platform since Mylyn does not do anything special with the font of
> the section. What Eclipse version and operating system are you using?

Eclipse 3.6.0
RedHat Enterprise Linux Client release 5.3
Comment 3 Felipe Heidrich CLA 2010-09-02 10:25:07 EDT
Not SWT
Comment 4 Chris Goldthorpe CLA 2010-09-28 18:06:03 EDT
Can you provide the full steps required to reproduce the bug starting from the Eclipse SDK, including the list of components that need to be installed from an update site to include Mylyn
Comment 5 Chris Goldthorpe CLA 2011-02-07 18:24:29 EST
Without more information I cannot investigate this bug, closing.
Comment 6 Steffen Pingel CLA 2011-02-16 18:51:50 EST
We have seen another instance of this problem. I have attached a simple snippet that reproduces the exception. 

It happens when a single toolkit is used to create two sections on parents that have different fonts. When the second section is created the bold font used for the title of the first section is disposed.
Comment 7 Steffen Pingel CLA 2011-02-16 18:52:22 EST
Created attachment 189145 [details]
snippet to reproduce bug
Comment 8 Chris Goldthorpe CLA 2011-02-17 16:43:59 EST
Thanks for the snippet, I will take a look at this.
Comment 9 Chris Goldthorpe CLA 2011-02-17 18:43:14 EST
Created attachment 189244 [details]
Patch

Here's a patch that fixes the snippet. With the patch FormToolkit does not dispose of any fonts it creates until the FormToolkiui is itself disposed. Can you try it out to verify that it fixes the original problem?
Comment 10 Chris Goldthorpe CLA 2011-02-18 15:59:48 EST
Patch committed to HEAD, Fixed
Comment 11 Chris Goldthorpe CLA 2011-02-21 12:37:32 EST
Setting status to Resolved/Fixed