summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Vitale2012-04-02 12:54:03 (EDT)
committer Pawel Piech2012-04-02 12:54:03 (EDT)
commit757835f722211c4acd2d534fe565d7fba0e640a7 (patch)
treed6f9db72ff1988d198ca7493864b616f15814f1b
parent11b41a7de12d45ce028d0665d3bb931236e09574 (diff)
downloadeclipse.platform.debug-757835f722211c4acd2d534fe565d7fba0e640a7.zip
eclipse.platform.debug-757835f722211c4acd2d534fe565d7fba0e640a7.tar.gz
eclipse.platform.debug-757835f722211c4acd2d534fe565d7fba0e640a7.tar.bz2
Bug 291832 - [launch] Handle shortcut enablement evaluation exceptions
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java8
2 files changed, 14 insertions, 2 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
index 6c43e42..0523227 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
@@ -20,6 +20,8 @@ import java.util.Set;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchManager;
@@ -217,7 +219,11 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
filteredShortCuts.add(ext);
}
}
- catch (CoreException e) {}
+ catch (CoreException e) {
+ IStatus status = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), "Launch shortcut '" + ext.getId() + "' enablement expression caused exception. Shortcut was removed.", e); //$NON-NLS-1$ //$NON-NLS-2$
+ DebugUIPlugin.log(status);
+ iter.remove();
+ }
}
iter = filteredShortCuts.iterator();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
index a9c25ed..3156ee8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
@@ -19,6 +19,8 @@ import java.util.Set;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
@@ -164,7 +166,11 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
if (!WorkbenchActivityHelper.filterItem(ext) && isApplicable(ext, context)) {
filteredShortCuts.add(ext);
}
- } catch (CoreException e) {/*not supported*/}
+ } catch (CoreException e) {
+ IStatus status = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), "Launch shortcut '" + ext.getId() + "' enablement expression caused exception. Shortcut was removed.", e); //$NON-NLS-1$ //$NON-NLS-2$
+ DebugUIPlugin.log(status);
+ iter.remove();
+ }
}
//first add the launch config if it is one
String mode = getMode();