diff options
author | Darin Wright | 2008-05-08 20:07:23 +0000 |
---|---|---|
committer | Darin Wright | 2008-05-08 20:07:23 +0000 |
commit | 9eb9c012cc98f12683c7fb3054127027f261e385 (patch) | |
tree | b6fcfef14b00b143affe55d6025d033e8b2a2787 /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching | |
parent | 36b4f1ce401fb7a9976e67cd1c72531877aa1577 (diff) | |
download | eclipse.platform.debug-9eb9c012cc98f12683c7fb3054127027f261e385.tar.gz eclipse.platform.debug-9eb9c012cc98f12683c7fb3054127027f261e385.tar.xz eclipse.platform.debug-9eb9c012cc98f12683c7fb3054127027f261e385.zip |
Bug 223851 - Contextual launch not choosing most recent configuration
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java index 6b07abb0b..ffa1840d9 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,6 +11,7 @@ package org.eclipse.debug.internal.ui.contextlaunching; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -475,7 +476,8 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo cfgs = ext.getLaunchConfigurations(selection); } if (cfgs == null) { - configs.addAll(DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations(new ArrayList(ext.getAssociatedConfigurationTypes()), resource)); + Set types = ext.getAssociatedConfigurationTypes(); + addAllToList(configs, DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations((String[]) types.toArray(new String[types.size()]), resource)); useDefault = true; } else if(cfgs.length > 0) { for(int j = 0; j < cfgs.length; j++) { @@ -487,7 +489,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo } if (useDefault) { // consider default configurations if the shortcuts did not contribute any - configs.addAll(DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations(null, resource)); + addAllToList(configs, DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations(null, resource)); } Iterator iterator = configs.iterator(); while (iterator.hasNext()) { @@ -505,6 +507,21 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo } /** + * Adds all of the items in the given object array to the given collection. + * Does nothing if either the collection or array is <code>null</code>. + * @param list + * @param values + */ + private void addAllToList(Collection list, Object[] values) { + if(list == null || values == null) { + return; + } + for(int i = 0; i < values.length; i++) { + list.add(values[i]); + } + } + + /** * Starts up the manager */ public void startup() { |