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 cd6402984cb..880155cacd7 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,6 +13,7 @@ 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 { @@ -34,8 +35,8 @@ public abstract class APathEntry extends PathEntry { */ public APathEntry (int kind, IPath basePath, IPath baseRef, IPath path, IPath[] exclusionPatterns, boolean isExported) { super(kind, path, isExported); - this.basePath = (basePath == null) ? EMPTY_PATH : basePath; - this.baseRef = (baseRef == null) ? EMPTY_PATH : baseRef; + this.basePath = (basePath == null) ? Path.EMPTY : basePath; + this.baseRef = (baseRef == null) ? Path.EMPTY : baseRef; this.exclusionPatterns = (exclusionPatterns == null) ? NO_EXCLUSION_PATTERNS : exclusionPatterns; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java index f488285f9b3..5f8a002ada6 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java @@ -16,6 +16,7 @@ import org.eclipse.cdt.core.model.IIncludeEntry; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; public class IncludeEntry extends APathEntry implements IIncludeEntry { IPath includePath; @@ -24,7 +25,7 @@ public class IncludeEntry extends APathEntry implements IIncludeEntry { public IncludeEntry(IPath resourcePath, IPath basePath, IPath baseRef, IPath includePath, boolean isSystemInclude, IPath[] exclusionPatterns, boolean isExported) { super(IIncludeEntry.CDT_INCLUDE, basePath, baseRef, resourcePath, exclusionPatterns, isExported); - this.includePath = (includePath == null) ? EMPTY_PATH : includePath; + this.includePath = (includePath == null) ? Path.EMPTY : includePath; this.isSystemInclude = isSystemInclude; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java index 4f2966b37a6..772fa650150 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java @@ -16,6 +16,7 @@ import org.eclipse.cdt.core.model.ILibraryEntry; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; public class LibraryEntry extends APathEntry implements ILibraryEntry { @@ -37,7 +38,7 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry { public LibraryEntry(IPath resourcePath, IPath basePath, IPath baseRef, IPath libraryPath, IPath sourceAttachmentPath, IPath sourceAttachmentRootPath, IPath sourceAttachmentPrefixMapping, boolean isExported) { super(ILibraryEntry.CDT_LIBRARY, basePath, baseRef, resourcePath, APathEntry.NO_EXCLUSION_PATTERNS, isExported); - this.libraryPath = (libraryPath == null) ? EMPTY_PATH : libraryPath; + this.libraryPath = (libraryPath == null) ? Path.EMPTY : libraryPath; this.sourceAttachmentPath = sourceAttachmentPath; this.sourceAttachmentRootPath = sourceAttachmentRootPath; this.sourceAttachmentPrefixMapping = sourceAttachmentPrefixMapping; 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 bd923d1c734..661b1669609 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 @@ -22,10 +22,8 @@ public class PathEntry implements IPathEntry { 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 == null) ? EMPTY_PATH : path; + this.path = (path == null) ? Path.EMPTY : path; this.entryKind = entryKind; this.isExported = isExported; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java index b27293edb21..a174db18375 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java @@ -234,7 +234,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange if (container != null) { IPathEntry[] entries = container.getPathEntries(); for (int i = 0; i < entries.length; i++) { - if (entries[i].getEntryKind() == IPathEntry.CDT_INCLUDE) { + if (entries[i].getEntryKind() == IPathEntry.CDT_LIBRARY) { ILibraryEntry refEntry = (ILibraryEntry)entries[i]; if (refEntry.getPath().equals(libraryPath)) { return CoreModel.newLibraryEntry(entry.getPath(), refEntry.getBasePath(),