diff options
2 files changed, 10 insertions, 10 deletions
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/SourceLookupFacilityTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/SourceLookupFacilityTests.java index 693f81b0e..f644e1bd8 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/SourceLookupFacilityTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/SourceLookupFacilityTests.java @@ -310,7 +310,7 @@ public class SourceLookupFacilityTests extends TestCase { String artifact = "" + i; //$NON-NLS-1$ ISourceLookupResult result = SourceLookupFacility.getDefault().lookup(artifact, fTestLocator, false); assertNotNull("There should be a result", result); //$NON-NLS-1$ - assertFalse(cached.containsKey(result)); + assertFalse(cached.containsValue(result)); cached.put(artifact, result); result = SourceLookupFacility.getDefault().lookup(artifact, fTestLocator, false); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java index 33fd45f6f..9db8d18b8 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java @@ -722,19 +722,18 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici * @since 3.3 */ public String[] getApplicableConfigurationTypes(IResource resource) { - List<String> types = new ArrayList<String>(); List<LaunchShortcutExtension> exts = getLaunchShortcuts(); List<IResource> list = new ArrayList<IResource>(); list.add(resource); IEvaluationContext context = DebugUIPlugin.createEvaluationContext(list); context.setAllowPluginActivation(true); context.addVariable("selection", list); //$NON-NLS-1$ - HashSet<String> set = new HashSet<String>(); + HashSet<String> contributedTypeIds = new HashSet<String>(); for (Iterator<LaunchShortcutExtension> iter = exts.listIterator(); iter.hasNext();) { LaunchShortcutExtension ext = iter.next(); try { if(ext.evalEnablementExpression(context, ext.getContextualLaunchEnablementExpression())) { - set.addAll(ext.getAssociatedConfigurationTypes()); + contributedTypeIds.addAll(ext.getAssociatedConfigurationTypes()); } } catch(CoreException ce) { @@ -743,17 +742,18 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici iter.remove(); } } + List<String> typeIds = new ArrayList<String>(); LaunchManager lm = (LaunchManager) DebugPlugin.getDefault().getLaunchManager(); - ILaunchConfigurationType type = null; - for (String id : set) { - type = lm.getLaunchConfigurationType(id); + for (String id : contributedTypeIds) { + ILaunchConfigurationType type = lm.getLaunchConfigurationType(id); if(type != null) { - if(!types.contains(type) && type.isPublic() && !"org.eclipse.ui.externaltools.builder".equals(type.getCategory())) { //$NON-NLS-1$ - types.add(type.getIdentifier()); + String identifier = type.getIdentifier(); + if (!typeIds.contains(identifier) && type.isPublic() && !"org.eclipse.ui.externaltools.builder".equals(type.getCategory())) { //$NON-NLS-1$ + typeIds.add(identifier); } } } - return types.toArray(new String[types.size()]); + return typeIds.toArray(new String[typeIds.size()]); } /** |