From 1b27065ccd658dd9ea5c689583262ad8ddc7b477 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 21 May 2008 14:18:44 +0000 Subject: [PATCH] Fix hashCode() and equals() for type-info objects. --- .../browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java index 2f05d66540a..94949ed3626 100644 --- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java +++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java @@ -531,6 +531,7 @@ public class IndexTypeInfo implements ITypeInfo, IFunctionInfo { final int prime = 31; int result = 1; result = prime * result + elementType; + result = prime * result + ((fileLocal == null) ? 0 : fileLocal.hashCode()); result = prime * result + IndexTypeInfo.hashCode(fqn); result = prime * result + IndexTypeInfo.hashCode(params); return result; @@ -550,6 +551,11 @@ public class IndexTypeInfo implements ITypeInfo, IFunctionInfo { IndexTypeInfo other = (IndexTypeInfo) obj; if (elementType != other.elementType) return false; + if (fileLocal == null) { + if (other.fileLocal != null) + return false; + } else if (!fileLocal.equals(other.fileLocal)) + return false; if (!Arrays.equals(fqn, other.fqn)) return false; if (!Arrays.equals(params, other.params))