private void copyMethodToTargetClass(IMethod method, CompilationUnit declaringCuNode, TypeDeclaration targetClass, OldASTRewrite targetRewrite, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException { MethodDeclaration newMethod= createNewMethodDeclarationNode(method, declaringCuNode, targetRewrite, pm, status); targetRewrite.markAsInserted(newMethod); int insertionIndex= ASTNodes.getInsertionIndex(newMethod, targetClass.bodyDeclarations()); targetClass.bodyDeclarations().add(insertionIndex, newMethod);
private void copyMethodToTargetClass(IMethod method, CompilationUnit declaringCuNode, TypeDeclaration targetClass, TypeVariableMaplet[] mapping, ASTRewrite rewrite, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException { MethodDeclaration newMethod= createNewMethodDeclarationNode(method, declaringCuNode, mapping, rewrite, pm, status); rewrite.getListRewrite(targetClass, TypeDeclaration.BODY_DECLARATIONS_PROPERTY).insertAt(newMethod, ASTNodes.getInsertionIndex(newMethod, targetClass.bodyDeclarations()), null);
	private void copyMethodToTargetClass(IMethod method, CompilationUnit declaringCuNode, TypeDeclaration targetClass, OldASTRewrite targetRewrite, IProgressMonitor pm, RefactoringStatus status) throws JavaModelException {		MethodDeclaration newMethod= createNewMethodDeclarationNode(method, declaringCuNode, targetRewrite, pm, status);		targetRewrite.markAsInserted(newMethod);		int insertionIndex= ASTNodes.getInsertionIndex(newMethod, targetClass.bodyDeclarations());		targetClass.bodyDeclarations().add(insertionIndex, newMethod);	}