private void copyTypeToTargetClass(IType type, CompilationUnit declaringCuNode, TypeDeclaration targetClass, OldASTRewrite rewrite) throws JavaModelException { BodyDeclaration newType= createNewTypeDeclarationNode(type, declaringCuNode, rewrite); rewrite.markAsInserted(newType); int insertionIndex= ASTNodes.getInsertionIndex(newType, targetClass.bodyDeclarations()); targetClass.bodyDeclarations().add(insertionIndex, newType);
private void copyTypeToTargetClass(IType type, CompilationUnit declaringCuNode, TypeDeclaration targetClass, TypeVariableMaplet[] mapping, ASTRewrite rewrite) throws JavaModelException { BodyDeclaration newType= createNewTypeDeclarationNode(type, declaringCuNode, mapping, rewrite); rewrite.getListRewrite(targetClass, TypeDeclaration.BODY_DECLARATIONS_PROPERTY).insertAt(newType, ASTNodes.getInsertionIndex(newType, targetClass.bodyDeclarations()), null);
	private void copyTypeToTargetClass(IType type, CompilationUnit declaringCuNode, TypeDeclaration targetClass, OldASTRewrite rewrite) throws JavaModelException {		BodyDeclaration newType= createNewTypeDeclarationNode(type, declaringCuNode, rewrite);		rewrite.markAsInserted(newType);		int insertionIndex= ASTNodes.getInsertionIndex(newType, targetClass.bodyDeclarations());		targetClass.bodyDeclarations().add(insertionIndex, newType);	}