Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339228 - [working sets] IllegalArgumentException when trying to enable "Sort working sets"
Summary: [working sets] IllegalArgumentException when trying to enable "Sort working s...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Raksha Vasisht CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-08 09:46 EST by Markus Keller CLA
Modified: 2011-03-16 08:15 EDT (History)
1 user (show)

See Also:
daniel_megert: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-03-08 09:46:18 EST
I20110307-2110

IllegalArgumentException when trying to enable "Sort working sets" in the Package Explorer:

java.lang.IllegalArgumentException:
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:47)
at org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.setWorkingSets(WorkingSetModel.java:434)
at org.eclipse.jdt.internal.ui.workingsets.ConfigureWorkingSetAction.run(ConfigureWorkingSetAction.java:59)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
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$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4114)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1443)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1451)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1263)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3960)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3599)
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)
Comment 1 Raksha Vasisht CLA 2011-03-09 08:20:09 EST
Fixed in WorkingSetConfigurationDialog.java . fAllWorkingSets is updated on Up or Down operations while configuring, but not when sort is enabled. Committed to HEAD.
Comment 2 Markus Keller CLA 2011-03-09 09:55:20 EST
The fix seems to work, but I find it a bit strange that we now sort fAllWorkingSets in WorkingSetConfigurationDialog#okPressed() and then we sort it again in WorkingSetModel#setWorkingSets(*).

In WorkingSetModel#setActiveWorkingSets(*), we're sorting as well, so all the Assert.isLegal(*) calls in setWorkingSets(*) are pretty pointless in case sorting is enabled.

We'll go with the current state for M6. Dani, please have a look at the change.
Comment 3 Markus Keller CLA 2011-03-11 07:07:18 EST
Verified in I20110310-1119.
Comment 4 Dani Megert CLA 2011-03-16 08:15:42 EDT
Fix was OK but no need to create a new comparator but use getComparator() instead.