Community
Participate
Working Groups
Build Identifier: org.eclipse.ui.workbench_3.7.0.I20110519-0100 WorkingSetConfigurationBlock from org.eclipse.ui.dialogs throws following exception when passing a zero-length array to setSelectedWorkingSets. I suspect the error will only happen if the setSelectedWorkingSets method is called after the combo has been instantiated. java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:4263) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Widget.error(Widget.java:466) at org.eclipse.swt.widgets.Combo.getItem(Combo.java:868) at org.eclipse.ui.dialogs.WorkingSetConfigurationBlock.updateSelectedWorkingSets(WorkingSetConfigurationBlock.java:412) at org.eclipse.ui.dialogs.WorkingSetConfigurationBlock.setWorkingSets(WorkingSetConfigurationBlock.java:191) at com.springsource.sts.gradle.ui.wizards.WorkingSetGroup.setSelectedWorkingSets(WorkingSetGroup.java:72) at com.springsource.sts.gradle.ui.wizards.GradleImportWizardPageOne$DefaultsSetter.restoreDefaults(GradleImportWizardPageOne.java:634) Reproducible: Always
I also run in to this bug and would like to amend that the exception also occurs when passing a non-empty array of working sets to setSelectedWorkingSets(). With this snippet, the bug can be reproduced: @Test public void testWorkingSetConfigurationBlockBug() { String type = "org.eclipse.ui.resourceWorkingSetPage"; IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSet workingSet = workingSetManager.createWorkingSet( "ws", new IAdaptable[ 0 ] ); workingSet.setId( type ); workingSetManager.addWorkingSet( workingSet ); Shell shell = new Shell(); WorkingSetConfigurationBlock workingSetBlock = new WorkingSetConfigurationBlock( new String[] { type }, new DialogSettings( "settings" ) ); workingSetBlock.createContent( shell ); workingSetBlock.setWorkingSets( new IWorkingSet[] { workingSet } ); assertArrayEquals( new IWorkingSet[] { workingSet }, workingSetBlock.getSelectedWorkingSets() ); }
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.