Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Duft2021-09-24 09:32:54 +0000
committerSarika Sinha2021-09-27 10:12:53 +0000
commit1c1475498bc6c1d69f802612d1ae1a8f789150fd (patch)
treee9204e60b2b1bca178216f9713e8537006d0c1ab
parent2f53ef8dcdd85b80224f64f197644ef31754694c (diff)
downloadeclipse.platform.debug-1c1475498bc6c1d69f802612d1ae1a8f789150fd.tar.gz
eclipse.platform.debug-1c1475498bc6c1d69f802612d1ae1a8f789150fd.tar.xz
eclipse.platform.debug-1c1475498bc6c1d69f802612d1ae1a8f789150fd.zip
Bug 513735: Fix NPE on launch configuration which do not support debugS4_22_0_M1I20210929-1800I20210929-0600I20210928-1800I20210928-0600I20210927-1800
This fixes an NPE e.g. for "Ant" launch configurations which don't support the debug mode. Change-Id: I5ea8aacf82efc4fe57a00520cf6ebac7d8592fa7 Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.debug/+/185802 Tested-by: Sarika Sinha <sarika.sinha@in.ibm.com> Reviewed-by: Sarika Sinha <sarika.sinha@in.ibm.com>
-rw-r--r--org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/impl/DebugCoreLaunchObject.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/impl/DebugCoreLaunchObject.java b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/impl/DebugCoreLaunchObject.java
index a2afee7af..a696ec648 100644
--- a/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/impl/DebugCoreLaunchObject.java
+++ b/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/impl/DebugCoreLaunchObject.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017, 2019 SSI Schaefer IT Solutions GmbH and others.
+ * Copyright (c) 2017, 2021 SSI Schaefer IT Solutions GmbH and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
*
* Contributors:
* SSI Schaefer IT Solutions GmbH
+ * IBM Corporation - Bug fixes
*******************************************************************************/
package org.eclipse.debug.ui.launchview.internal.impl;
@@ -29,6 +30,7 @@ import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchMode;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.ILaunchGroup;
import org.eclipse.debug.ui.launchview.internal.LaunchViewBundleInfo;
import org.eclipse.debug.ui.launchview.internal.LaunchViewMessages;
import org.eclipse.debug.ui.launchview.internal.launcher.StandaloneLaunchConfigExecutor;
@@ -135,11 +137,19 @@ public class DebugCoreLaunchObject implements ILaunchObject, Comparable<ILaunchO
@Override
public void edit() {
- // TODO: This uses "debug" mode ALWAYS as the Eclipse infrastructure
+ // This prefers "debug" mode as the Eclipse infrastructure
// requires a group to be given. This covers most launch configurations
// as most of them support debug, whereas e.g. "Remote Java Application"
- // does not support "run".
- DebugUITools.openLaunchConfigurationDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), config, DebugUITools.getLaunchGroup(config, "debug").getIdentifier(), null); //$NON-NLS-1$
+ // does not support "run". Ant launch configurations in turn do not
+ // support debug...
+ ILaunchGroup group = DebugUITools.getLaunchGroup(config, "debug"); //$NON-NLS-1$
+ if (group == null) {
+ group = DebugUITools.getLaunchGroup(config, "run"); //$NON-NLS-1$
+ }
+ if (group != null) { // Id Debug & run both not supported and only
+ // profile is supported
+ DebugUITools.openLaunchConfigurationDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), config, group.getIdentifier(), null);
+ }
}
@Override

Back to the top