From 23d43b4d7d63328a4e13f3653749d590fef7d588 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Fri, 23 Jan 2009 08:38:10 +0000 Subject: [PATCH] Bug 261287 - Includes Grouping can get confused --- .../ui/cview/IncludeReferenceProxy.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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() */