Index: editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniElement.java |
=================================================================== |
--- editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniElement.java (revision 8261) |
+++ editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniElement.java (working copy) |
@@ -134,9 +134,25 @@ |
} |
/** |
- * @param filter |
- * @return |
+ * Tests for equivalency ("equalness" without the contract of {@link Object#equals(Object)}. |
+ * |
+ * @param that the element to test against |
+ * @return <code>true</code> if this element is the "same as" or "equivalent to" the other, |
+ * <code>false</code> otherwise |
*/ |
+ public boolean isSameAs(OmniElement that) { |
+ if (that == null) { |
+ return false; |
+ } |
+ if (this == that) { |
+ return true; |
+ } |
+ if (this.getProvider() == that.getProvider()) { |
+ return this.getLabel() == that.getLabel(); |
+ } |
+ return false; |
+ } |
+ |
public OmniEntry match(String filter, OmniProposalProvider providerForMatching) { |
String sortLabel = getMatchText(); |