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:
parent
63563deaf8
commit
db8b15aacf
1 changed files with 17 additions and 15 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue