mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
findElement check for relative path.
This commit is contained in:
parent
562219c341
commit
aa2c9be127
1 changed files with 14 additions and 3 deletions
|
@ -45,9 +45,20 @@ public class CProject extends CResource implements ICProject {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICElement findElement(IPath path) throws CModelException {
|
public ICElement findElement(IPath path) throws CModelException {
|
||||||
ICElement celem = CModelManager.getDefault().create(path);
|
ICElement celem = null;
|
||||||
if (celem == null)
|
if (path.isAbsolute()) {
|
||||||
new CModelStatus(ICModelStatusConstants.INVALID_PATH, path);
|
celem = CModelManager.getDefault().create(path);
|
||||||
|
} else {
|
||||||
|
IProject project = getProject();
|
||||||
|
if (project != null) {
|
||||||
|
IPath p = project.getFullPath().append(path);
|
||||||
|
celem = CModelManager.getDefault().create(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (celem == null) {
|
||||||
|
CModelStatus status = new CModelStatus(ICModelStatusConstants.INVALID_PATH, path);
|
||||||
|
throw new CModelException(status);
|
||||||
|
}
|
||||||
return celem;
|
return celem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue