1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

findElement check for relative path.

This commit is contained in:
Alain Magloire 2002-11-01 20:11:21 +00:00
parent 562219c341
commit aa2c9be127

View file

@ -45,9 +45,20 @@ public class CProject extends CResource implements ICProject {
}
public ICElement findElement(IPath path) throws CModelException {
ICElement celem = CModelManager.getDefault().create(path);
if (celem == null)
new CModelStatus(ICModelStatusConstants.INVALID_PATH, path);
ICElement celem = null;
if (path.isAbsolute()) {
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;
}