mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
remove side effect of findInsertLocation()
This commit is contained in:
parent
e9b5691317
commit
a33b8d111f
1 changed files with 5 additions and 3 deletions
|
@ -94,7 +94,7 @@ public class ImplementMethodRefactoring extends CRefactoring {
|
|||
parameterHandler.initArgumentNames();
|
||||
sm.worked(1);
|
||||
sm.done();
|
||||
findInsertLocation();
|
||||
insertLocation = findInsertLocation();
|
||||
sm.worked(1);
|
||||
sm.done();
|
||||
return initStatus;
|
||||
|
@ -136,13 +136,15 @@ public class ImplementMethodRefactoring extends CRefactoring {
|
|||
}
|
||||
}
|
||||
|
||||
private void findInsertLocation() throws CoreException {
|
||||
insertLocation = MethodDefinitionInsertLocationFinder.find(methodDeclaration.getFileLocation(), methodDeclaration.getParent(), file);
|
||||
private InsertLocation findInsertLocation() throws CoreException {
|
||||
InsertLocation insertLocation = MethodDefinitionInsertLocationFinder.find(methodDeclaration.getFileLocation(), methodDeclaration.getParent(), file);
|
||||
|
||||
if (!insertLocation.hasFile() || NodeHelper.isContainedInTemplateDeclaration(methodDeclaration)) {
|
||||
insertLocation.setInsertFile(file);
|
||||
insertLocation.setNodeToInsertAfter(NodeHelper.findTopLevelParent(methodDeclaration));
|
||||
}
|
||||
|
||||
return insertLocation;
|
||||
}
|
||||
|
||||
private void createFunctionDefinition(IASTTranslationUnit unit) throws CoreException {
|
||||
|
|
Loading…
Add table
Reference in a new issue