1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

[165674] sorting subsystem configurations to be aphabetical in order

This commit is contained in:
David McKnight 2007-07-16 16:13:04 +00:00
parent 0cce191cc3
commit daef342bea

View file

@ -32,6 +32,7 @@
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
* Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core
* Xuan Chen (IBM) - [194838] Move the code for comparing two objects by absolute name to a common location
* David McKnight (IBM) - [165674] Sort subsystem configurations to be in deterministic order
********************************************************************************/
package org.eclipse.rse.ui.internal.model;
@ -359,6 +360,27 @@ public class SystemRegistry implements ISystemRegistry
v.addElement(ssFactory);
}
else // for 165674 - fix the order to be deterministic
{
// replace with this one if this is first alphabetically
// find the current one
for (int i = 0; i < v.size(); i++)
{
if (v.get(i) instanceof IServiceSubSystemConfiguration)
{
IServiceSubSystemConfiguration addedConfig = (IServiceSubSystemConfiguration)v.get(i);
if (addedConfig.getServiceType() == serviceType)
{
if (serviceFactory.getName().compareTo(addedConfig.getName()) <= 0)
{
v.remove(addedConfig);
v.add(serviceFactory);
}
}
}
}
}
}
else
{