From fa7704633a46be7ce09cf15f1f3defca4eee22c4 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Fri, 30 Apr 2004 22:51:11 +0000 Subject: [PATCH] Override equals in the PathEntry class --- .../cdt/internal/core/model/APathEntry.java | 2 -- .../eclipse/cdt/internal/core/model/PathEntry.java | 14 ++++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java index 6d4882c9113..cd6402984cb 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java @@ -13,12 +13,10 @@ package org.eclipse.cdt.internal.core.model; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; public abstract class APathEntry extends PathEntry { public static IPath[] NO_EXCLUSION_PATTERNS = {}; - public final static IPath EMPTY_PATH = new Path(""); IPath[] exclusionPatterns; IPath basePath; IPath baseRef; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntry.java index 93a925543a4..bd923d1c734 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntry.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntry.java @@ -14,15 +14,18 @@ package org.eclipse.cdt.internal.core.model; import org.eclipse.cdt.core.model.IPathEntry; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; public class PathEntry implements IPathEntry { - public int entryKind; - public boolean isExported; - public IPath path; + protected int entryKind; + protected boolean isExported; + protected IPath path; + + public final static IPath EMPTY_PATH = new Path(""); public PathEntry(int entryKind, IPath path, boolean isExported) { - this.path = path; + this.path = (path == null) ? EMPTY_PATH : path; this.entryKind = entryKind; this.isExported = isExported; } @@ -51,6 +54,9 @@ public class PathEntry implements IPathEntry { public boolean equals(Object obj) { if (obj instanceof IPathEntry) { IPathEntry otherEntry = (IPathEntry)obj; + if (!path.equals(otherEntry.getPath())) { + return false; + } if (entryKind != otherEntry.getEntryKind()) { return false; }