Project: JDT
Bug 338531 Wrong ordering of elements in WorkingSetModel.fAllWorkingSets
Reported: 2011-03-01 08:52:27 | Status: verified fixed

When setting the elements using WorkingSetModel.setWorkingSets(IWorkingSet[], boolean, IWorkingSet[]) or WorkingSetModel.setActiveWorkingSets(IWorkingSet[]) then the ordering in fActiveWorkingSets and fAllWorkingSets can differ. This is bad because that ordering is used in the dialog and the drop adapter. Test Case: 1. In PackageExplorerPart.internalTestShowWorkingSets replace fWorkingSetModel.setWorkingSets(workingSets, false, workingSets); with: fWorkingSetModel.setActiveWorkingSets(workingSets); 2. Run org.eclipse.jdt.ui.tests.packageview.WorkingSetDropAdapterTest ==> test failure. This happens because previous tests created a different order and when we then set [w1,w2,w3] the order in active and all is different. ==> we need to ensure that the same relative ordering is used.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/WorkingSetModel.java