diff options
author | Chin Huat Ang | 2018-03-07 15:50:43 +0000 |
---|---|---|
committer | Chin Huat Ang | 2018-03-07 15:50:43 +0000 |
commit | 13b1894c4c5003a8b7697b90ca1208b047c9798e (patch) | |
tree | 44ebc9ca1c14b793f027c15a984fc012cd7938d8 | |
parent | 82b0f6ab282867a0d815f991cd60227402bb61c0 (diff) | |
download | org.eclipse.cdt-13b1894c4c5003a8b7697b90ca1208b047c9798e.tar.gz org.eclipse.cdt-13b1894c4c5003a8b7697b90ca1208b047c9798e.tar.xz org.eclipse.cdt-13b1894c4c5003a8b7697b90ca1208b047c9798e.zip |
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>
-rw-r--r-- | core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java index 79bd82987d1..6db98c2bf27 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java @@ -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; } } } |