Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2014-08-11 20:19:25 +0000
committerElena Laskavaia2014-08-12 15:52:17 +0000
commitbc0a8fb72f7008be7735f046ea459badaa660b67 (patch)
tree578042c27d78dd2e85c232ff175703ca2c7b567b
parenta458a0fe9fcd96ca7fc961488e96f3f04cc963a8 (diff)
downloadorg.eclipse.cdt-bc0a8fb72f7008be7735f046ea459badaa660b67.tar.gz
org.eclipse.cdt-bc0a8fb72f7008be7735f046ea459badaa660b67.tar.xz
org.eclipse.cdt-bc0a8fb72f7008be7735f046ea459badaa660b67.zip
LaunchBar - project based descriptor bug
project based descriptor must not accept launch configs without project set ownProject should not log exception when lc does not exist Change-Id: I9a600641324b0ae22a2fdb99e68ff530cd1d33df Reviewed-on: https://git.eclipse.org/r/31400 Reviewed-by: Elena Laskavaia <elaskavaia.cdt@gmail.com> Tested-by: Elena Laskavaia <elaskavaia.cdt@gmail.com>
-rw-r--r--launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/ConfigBasedLaunchConfigurationProvider.java3
-rw-r--r--launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/ProjectBasedLaunchDescriptorType.java6
2 files changed, 9 insertions, 0 deletions
diff --git a/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/ConfigBasedLaunchConfigurationProvider.java b/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/ConfigBasedLaunchConfigurationProvider.java
index cee7f779560..ca88f6afa7c 100644
--- a/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/ConfigBasedLaunchConfigurationProvider.java
+++ b/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/ConfigBasedLaunchConfigurationProvider.java
@@ -14,6 +14,7 @@ import java.util.HashMap;
import org.eclipse.cdt.launchbar.core.internal.Activator;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
@@ -33,6 +34,8 @@ public class ConfigBasedLaunchConfigurationProvider extends AbstractLaunchConfig
if (configMap.containsKey(element))
return true;
return element.getType().getIdentifier().equals(typeId);
+ } catch (DebugException e) {
+ return false; // config does not exists, not point logging
} catch (CoreException e) {
Activator.log(e);
return false;
diff --git a/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/ProjectBasedLaunchDescriptorType.java b/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/ProjectBasedLaunchDescriptorType.java
index 4f0e9f1a533..c1f087e36e4 100644
--- a/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/ProjectBasedLaunchDescriptorType.java
+++ b/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/ProjectBasedLaunchDescriptorType.java
@@ -27,6 +27,10 @@ public abstract class ProjectBasedLaunchDescriptorType extends ConfigBasedLaunch
return false;
}
+ public boolean ownsConfiguration(ILaunchConfiguration element) {
+ return super.ownsConfiguration(element) && getProject(element) != null;
+ }
+
protected boolean ownsLaunchDescriptor(ILaunchDescriptor ld) {
if (!(ld instanceof ProjectBasedLaunchDescriptorType))
return false;
@@ -41,6 +45,8 @@ public abstract class ProjectBasedLaunchDescriptorType extends ConfigBasedLaunch
if (element instanceof ILaunchConfiguration) {
ILaunchConfiguration llc = (ILaunchConfiguration) element;
IProject project = getProject(llc);
+ if (project == null)
+ return null;
// TODO we need disable project based descriptor here
return new ProjectBasedLaunchDescriptor(this, project, llc);
} else if (element instanceof IProject) {

Back to the top