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 7ed251d8d58..b086d31d71a 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 @@ -85,36 +85,32 @@ public class IncludeEntry extends APathEntry implements IIncludeEntry { * @see org.eclipse.cdt.core.model.IIncludeEntry#getFullIncludePath() */ public IPath getFullIncludePath() { - IPath p; - IPath inc = getIncludePath(); + final IPath inc = getIncludePath(); if (!basePath.isEmpty()) { IPath loc = basePath; if (!loc.isAbsolute()) { IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(loc.append(inc)); if (res != null) { - return res.getLocation(); + IPath location = res.getLocation(); + if (location != null) { + return location; + } } } - p = loc.append(inc); - return p; + return loc.append(inc); } - p = inc; - - if (!p.isAbsolute()) { + if (!inc.isAbsolute()) { IPath resPath = getPath(); - IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath); + IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath.append(inc)); if (res != null) { - if (res.getType() == IResource.FILE) { - res = res.getParent(); - } IPath location = res.getLocation(); if (location != null) { - p = location.append(p); + return location; } } } - return p; + return inc; } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeFileEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeFileEntry.java index a18c0a9335f..94afb0e213f 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeFileEntry.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeFileEntry.java @@ -73,36 +73,32 @@ public class IncludeFileEntry extends APathEntry implements IIncludeFileEntry { * @see org.eclipse.cdt.core.model.IIncludeEntry#getFullIncludePath() */ public IPath getFullIncludeFilePath() { - IPath p; - IPath inc = getIncludeFilePath(); + final IPath inc = getIncludeFilePath(); if (!basePath.isEmpty()) { IPath loc = basePath; if (!loc.isAbsolute()) { - IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(loc); + IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(loc.append(inc)); if (res != null) { - loc = res.getLocation(); + IPath location = res.getLocation(); + if (location != null) { + return location; + } } } - p = loc.append(inc); - return p; + return loc.append(inc); } - p = inc; - - if (!p.isAbsolute()) { + if (!inc.isAbsolute()) { IPath resPath = getPath(); - IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath); + IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath.append(inc)); if (res != null) { - if (res.getType() == IResource.FILE) { - res = res.getParent(); - } IPath location = res.getLocation(); if (location != null) { - p = location.append(p); + return location; } } } - return p; + return inc; } /* (non-Javadoc)