Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2004-04-30 22:51:11 +0000
committerAlain Magloire2004-04-30 22:51:11 +0000
commitfa7704633a46be7ce09cf15f1f3defca4eee22c4 (patch)
treefc537a8cd343e55c263e08ef05d090a8f7d504d2
parenta075f3082c4c1b95ea03a814a3a5ec6b94e99357 (diff)
downloadorg.eclipse.cdt-fa7704633a46be7ce09cf15f1f3defca4eee22c4.tar.gz
org.eclipse.cdt-fa7704633a46be7ce09cf15f1f3defca4eee22c4.tar.xz
org.eclipse.cdt-fa7704633a46be7ce09cf15f1f3defca4eee22c4.zip
Override equals in the PathEntry class
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java2
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntry.java14
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;
}

Back to the top