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:
parent
a075f3082c
commit
fa7704633a
2 changed files with 10 additions and 6 deletions
|
@ -13,12 +13,10 @@
|
||||||
package org.eclipse.cdt.internal.core.model;
|
package org.eclipse.cdt.internal.core.model;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.Path;
|
|
||||||
|
|
||||||
public abstract class APathEntry extends PathEntry {
|
public abstract class APathEntry extends PathEntry {
|
||||||
|
|
||||||
public static IPath[] NO_EXCLUSION_PATTERNS = {};
|
public static IPath[] NO_EXCLUSION_PATTERNS = {};
|
||||||
public final static IPath EMPTY_PATH = new Path("");
|
|
||||||
IPath[] exclusionPatterns;
|
IPath[] exclusionPatterns;
|
||||||
IPath basePath;
|
IPath basePath;
|
||||||
IPath baseRef;
|
IPath baseRef;
|
||||||
|
|
|
@ -14,15 +14,18 @@ package org.eclipse.cdt.internal.core.model;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.IPathEntry;
|
import org.eclipse.cdt.core.model.IPathEntry;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
public class PathEntry implements IPathEntry {
|
public class PathEntry implements IPathEntry {
|
||||||
|
|
||||||
public int entryKind;
|
protected int entryKind;
|
||||||
public boolean isExported;
|
protected boolean isExported;
|
||||||
public IPath path;
|
protected IPath path;
|
||||||
|
|
||||||
|
public final static IPath EMPTY_PATH = new Path("");
|
||||||
|
|
||||||
public PathEntry(int entryKind, IPath path, boolean isExported) {
|
public PathEntry(int entryKind, IPath path, boolean isExported) {
|
||||||
this.path = path;
|
this.path = (path == null) ? EMPTY_PATH : path;
|
||||||
this.entryKind = entryKind;
|
this.entryKind = entryKind;
|
||||||
this.isExported = isExported;
|
this.isExported = isExported;
|
||||||
}
|
}
|
||||||
|
@ -51,6 +54,9 @@ public class PathEntry implements IPathEntry {
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof IPathEntry) {
|
if (obj instanceof IPathEntry) {
|
||||||
IPathEntry otherEntry = (IPathEntry)obj;
|
IPathEntry otherEntry = (IPathEntry)obj;
|
||||||
|
if (!path.equals(otherEntry.getPath())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (entryKind != otherEntry.getEntryKind()) {
|
if (entryKind != otherEntry.getEntryKind()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue