1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 13:25:45 +02:00

Bug 531991 - Fix command launcher manager priority comparison

When iterating through a list of command launcher factory to select the
highest priority factory, be sure to compare using the last known
highest priority.


Change-Id: I473ac9c8ff7cfb5a0aa81714101a795816fd1ac8
Signed-off-by: Chin Huat Ang <chin.huat.ang@intel.com>
This commit is contained in:
Chin Huat Ang 2018-03-07 23:50:43 +08:00
parent 82b0f6ab28
commit 13b1894c4c

View file

@ -178,8 +178,10 @@ public class CommandLauncherManager {
for (ICommandLauncherFactory factory : factories) {
ICommandLauncher launcher = factory.getCommandLauncher(project);
if (launcher != null) {
if (priorityMapping.get(factory) > highestPriority) {
int factoryPriority = priorityMapping.get(factory);
if (factoryPriority > highestPriority) {
bestLauncher = launcher;
highestPriority = factoryPriority;
}
}
}
@ -206,8 +208,10 @@ public class CommandLauncherManager {
if (factory instanceof ICommandLauncherFactory2) {
ICommandLauncher launcher = ((ICommandLauncherFactory2)factory).getCommandLauncher(config);
if (launcher != null) {
if (priorityMapping.get(factory) > highestPriority) {
int factoryPriority = priorityMapping.get(factory);
if (factoryPriority > highestPriority) {
bestLauncher = launcher;
highestPriority = factoryPriority;
}
}
}
@ -233,8 +237,10 @@ public class CommandLauncherManager {
for (ICommandLauncherFactory factory : factories) {
ICommandLauncher launcher = factory.getCommandLauncher(cfgd);
if (launcher != null) {
if (priorityMapping.get(factory) > highestPriority) {
int factoryPriority = priorityMapping.get(factory);
if (factoryPriority > highestPriority) {
bestLauncher = launcher;
highestPriority = factoryPriority;
}
}
}