1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

NPE invoking rename refactoring, bug 244866.

This commit is contained in:
Markus Schorn 2008-09-02 11:15:55 +00:00
parent 63563deaf8
commit db8b15aacf

View file

@ -822,21 +822,23 @@ public class ASTManager {
pm.worked(1);
if (tu != null) {
IASTName name= tu.getNodeSelector(tu.getFilePath()).findEnclosingName(fArgument.getOffset(), fArgument.getLength());
if (name instanceof ICPPASTQualifiedName) {
IASTName[] na= ((ICPPASTQualifiedName) name).getNames();
name= na[na.length-1];
}
fArgument.setName(name);
IBinding binding= name.resolveBinding();
if (binding != null) {
IScope scope= null;
try {
scope = binding.getScope();
} catch (DOMException e) {
handleDOMException(tu, e, status);
}
fArgument.setBinding(name.getTranslationUnit(), binding, scope);
}
if (name != null) {
if (name instanceof ICPPASTQualifiedName) {
IASTName[] na= ((ICPPASTQualifiedName) name).getNames();
name= na[na.length-1];
}
fArgument.setName(name);
IBinding binding= name.resolveBinding();
if (binding != null) {
IScope scope= null;
try {
scope = binding.getScope();
} catch (DOMException e) {
handleDOMException(tu, e, status);
}
fArgument.setBinding(name.getTranslationUnit(), binding, scope);
}
}
}
pm.worked(1);
pm.done();