diff options
author | Markus Duft | 2017-08-07 11:20:26 +0000 |
---|---|---|
committer | Markus Duft | 2017-08-07 11:21:32 +0000 |
commit | 8df4ce30969f1cca45747373252de64a5077c840 (patch) | |
tree | 48f1d690dcdc6bb0db84ccda0bee63cad3df9b78 /org.eclipse.debug.core | |
parent | 0bbc5012c2fd32f76a7cebebb0698d9e6ed1e0f8 (diff) | |
download | eclipse.platform.debug-8df4ce30969f1cca45747373252de64a5077c840.tar.gz eclipse.platform.debug-8df4ce30969f1cca45747373252de64a5077c840.tar.xz eclipse.platform.debug-8df4ce30969f1cca45747373252de64a5077c840.zip |
Bug 519684 - don't execute post launch actions when adopting
When adopting already existing launches, the group should not execute
that launches post launch action. Also notification about a launched
group element can/must be inhibited.
Change-Id: I3e162f376eb6a47a4580f4ddb20257962b33ed53
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
Diffstat (limited to 'org.eclipse.debug.core')
-rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchConfigurationDelegate.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchConfigurationDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchConfigurationDelegate.java index fbd3397d4..c948c63b3 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchConfigurationDelegate.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchConfigurationDelegate.java @@ -147,8 +147,10 @@ public class GroupLaunchConfigurationDelegate extends LaunchConfigurationDelegat private boolean launchChild(SubMonitor monitor, final GroupLaunch group, GroupLaunchElement le, final ILaunchConfiguration child, final String localMode, boolean lastConfig) throws CoreException { final Set<ILaunch> running = le.adoptIfRunning ? findRunningLaunch(le.name) : Collections.emptySet(); ILaunch subLaunch = running.stream().findFirst().orElse(null); + boolean launched = false; if (subLaunch == null) { subLaunch = child.launch(localMode, monitor); + launched = true; } group.addSubLaunch(subLaunch); @@ -159,11 +161,13 @@ public class GroupLaunchConfigurationDelegate extends LaunchConfigurationDelegat // So, fake another event now. group.launchChanged(subLaunch); - // give handler a chance to perform additional actions after - // launching each of the members. - IStatusHandler postLaunchHandler = DebugPlugin.getDefault().getStatusHandler(GROUP_ELEMENT_STARTED); - postLaunchHandler.handleStatus(GROUP_ELEMENT_STARTED, new ILaunch[] { - group, subLaunch }); + if (launched) { + // give handler a chance to perform additional actions after + // launching each of the members. + IStatusHandler postLaunchHandler = DebugPlugin.getDefault().getStatusHandler(GROUP_ELEMENT_STARTED); + postLaunchHandler.handleStatus(GROUP_ELEMENT_STARTED, new ILaunch[] { + group, subLaunch }); + } // if this is the last child, mark the group as "launching finished", so // that from now on the last terminating child will also terminate the @@ -172,7 +176,13 @@ public class GroupLaunchConfigurationDelegate extends LaunchConfigurationDelegat group.markLaunched(); } - return postLaunchAction(subLaunch, le, monitor); + // in case we adopted the launch, and did not launch outselves, don't + // execute the post launch action! + if (launched) { + return postLaunchAction(subLaunch, le, monitor); + } else { + return true; + } } private boolean postLaunchAction(ILaunch subLaunch, GroupLaunchElement le, IProgressMonitor monitor) { |