1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Override equals in the PathEntry class

This commit is contained in:
Alain Magloire 2004-04-30 22:51:11 +00:00
parent a075f3082c
commit fa7704633a
2 changed files with 10 additions and 6 deletions

View file

@ -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;

View file

@ -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;
}