diff options
Diffstat (limited to 'org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java')
-rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java index 3b2751197..6e633e9b8 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2013 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 @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.debug.internal.core; - + import java.util.Comparator; import org.eclipse.core.runtime.CoreException; @@ -19,44 +19,46 @@ import org.eclipse.debug.core.DebugPlugin; /** * Proxy to a runtime classpath entry resolver extension. - * + * * @see IConfigurationElementConstants */ -public class LaunchConfigurationComparator implements Comparator { +public class LaunchConfigurationComparator implements Comparator<Object> { private IConfigurationElement fConfigurationElement; - - private Comparator fDelegate; - + + private Comparator<Object> fDelegate; + /** * Constructs a new resolver on the given configuration element - * + * * @param element configuration element */ public LaunchConfigurationComparator(IConfigurationElement element) { fConfigurationElement = element; } - + /** * Returns the {@link Comparator} delegate - * + * * @return the {@link Comparator} */ - protected Comparator getComparator() { + @SuppressWarnings("unchecked") + protected Comparator<Object> getComparator() { if (fDelegate == null) { try { - fDelegate = (Comparator)fConfigurationElement.createExecutableExtension(IConfigurationElementConstants.CLASS); + fDelegate = (Comparator<Object>) fConfigurationElement.createExecutableExtension(IConfigurationElementConstants.CLASS); } catch (CoreException e) { DebugPlugin.log(e); } } return fDelegate; } - + /** * @see Comparator#compare(Object, Object) */ + @Override public int compare(Object o1, Object o2) { return getComparator().compare(o1, o2); } @@ -64,8 +66,13 @@ public class LaunchConfigurationComparator implements Comparator { /** * @see Object#equals(Object) */ + @Override public boolean equals(Object obj) { return getComparator().equals(obj); } + @Override + public int hashCode() { + return getComparator().hashCode(); + } } |