Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341638 - LaunchConfigurationsDialog#restoreExpansion() should not pass same element more than once
Summary: LaunchConfigurationsDialog#restoreExpansion() should not pass same element mo...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 trivial (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-01 10:42 EDT by Markus Keller CLA
Modified: 2011-05-06 18:47 EDT (History)
2 users (show)

See Also:
pawel.1.piech: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-04-01 10:42:56 EDT
N20110330-2000

LaunchConfigurationsDialog#restoreExpansion() should not pass the same element multiple times to TreeViewer#setExpandedElements(..).

The fix is simply to replace
	ArrayList toexpand = new ArrayList();
with
	HashSet toexpand = new HashSet();


In HEAD, equal elements in viewers can be found by setting these debug options:

org.eclipse.jface/debug=true
org.eclipse.jface/debug/viewers/equalElements=true

This logs such occurrences:

Warning
Thu Mar 31 18:23:51 CEST 2011
Sibling elements in viewer must not be equal:
  org.eclipse.debug.internal.core.LaunchConfigurationType@e78ed0,
  org.eclipse.debug.internal.core.LaunchConfigurationType@e78ed0

java.lang.RuntimeException
	at org.eclipse.jface.viewers.StructuredViewer.assertElementsNotNull(StructuredViewer.java:613)
	at org.eclipse.jface.viewers.AbstractTreeViewer.setExpandedElements(AbstractTreeViewer.java:2390)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.restoreExpansion(LaunchConfigurationsDialog.java:1204)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.initializeContent(LaunchConfigurationsDialog.java:1084)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.createContents(LaunchConfigurationsDialog.java:436)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.create(LaunchConfigurationsDialog.java:367)
	at org.eclipse.jface.window.Window.open(Window.java:790)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:1130)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.openLaunchConfigurationsDialog(DebugUIPlugin.java:708)
	at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:396)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4163)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	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:344)
	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:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 1 Michael Rennie CLA 2011-04-05 10:34:17 EDT
applied suggested fix to HEAD, thanks Markus.
Comment 2 Pawel Piech CLA 2011-05-06 18:47:46 EDT
Reviewed.