Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Ryall2009-06-04 12:35:21 +0000
committerKen Ryall2009-06-04 12:35:21 +0000
commit4f7831b525c085064f23026d101b2d7174d13e0f (patch)
treecaad2aad6d207c626557ad7d714c1c9fab65b60f
parent16c0c772959dc393fa6a476210cf43a78e5513ff (diff)
downloadorg.eclipse.cdt-4f7831b525c085064f23026d101b2d7174d13e0f.tar.gz
org.eclipse.cdt-4f7831b525c085064f23026d101b2d7174d13e0f.tar.xz
org.eclipse.cdt-4f7831b525c085064f23026d101b2d7174d13e0f.zip
Bug 196885, cache the "is the exe a binary" value.
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
index b9dff1d42a5..82dec0564f0 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
@@ -13,8 +13,10 @@
package org.eclipse.cdt.launch.ui;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ICDescriptor;
@@ -128,6 +130,8 @@ public class CMainTab extends CLaunchConfigurationTab {
/** @since 6.0 */
public static final int SPECIFY_CORE_FILE = 4;
+ private final Map<IPath, Boolean> fBinaryExeCache = new HashMap<IPath, Boolean>();
+
public CMainTab() {
this(WANTS_TERMINAL);
@@ -790,8 +794,14 @@ public class CMainTab extends CLaunchConfigurationTab {
*/
protected boolean isBinary(IProject project, IPath exePath) throws CoreException {
try {
- IBinaryObject exe = LaunchUtils.getBinary(project, exePath);
- return exe != null;
+ Boolean binValue = fBinaryExeCache.get(exePath);
+ if (binValue == null)
+ {
+ IBinaryObject exe = LaunchUtils.getBinary(project, exePath);
+ binValue = exe != null;
+ fBinaryExeCache.put(exePath, binValue);
+ }
+ return binValue;
} catch (ClassCastException e) {
}
return false;

Back to the top