diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/IncludeReferenceProxy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/IncludeReferenceProxy.java index 26b8a74e04c..4cba7777a32 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/IncludeReferenceProxy.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/IncludeReferenceProxy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. + * Copyright (c) 2000, 2008 QNX Software Systems 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 @@ -76,9 +76,24 @@ public class IncludeReferenceProxy extends CElementGrouping { */ @Override public boolean equals(Object obj) { - return reference.equals(obj); + if (this == obj) { + return true; + } + if (!(obj instanceof IncludeReferenceProxy)) { + return false; + } + IncludeReferenceProxy other = (IncludeReferenceProxy) obj; + return reference.equals(other.reference); } + /* + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + return reference.hashCode(); + } + /* (non-Javadoc) * @see java.lang.Object#toString() */