copyMembersToTargetClass(declaringCuNode, cuNode, rewrite, new SubProgressMonitor(subPm, 1), status); createAbstractMethodsInTargetClass(cuNode, declaringCuNode, rewrite, new SubProgressMonitor(subPm, 1), status);
TypeVariableMaplet[] mapping= TypeVariableUtil.subTypeToSuperType(getDeclaringType(), getTargetClass()); copyMembersToTargetClass(declaringCuNode, cuNode, mapping, rewrite, new SubProgressMonitor(subPm, 1), status); createAbstractMethodsInTargetClass(cuNode, declaringCuNode, mapping, rewrite, new SubProgressMonitor(subPm, 1), status);
	private TextChangeManager createChangeManager(IProgressMonitor pm, RefactoringStatus status) throws CoreException{		try{			pm.beginTask(RefactoringCoreMessages.getString("PullUpRefactoring.preview"), 4); //$NON-NLS-1$			ICompilationUnit declaringCu= getDeclaringCU();			CompilationUnit declaringCuNode= new RefactoringASTParser(AST.JLS3).parse(declaringCu, true);						addImportsToTargetCu(new SubProgressMonitor(pm, 1), declaringCuNode);			TextChangeManager manager= new TextChangeManager();			//ICompilationUnit -> List of IMember			Map membersToDeleteMap= createMembersToDeleteMap(new SubProgressMonitor(pm, 1));			//ICompilationUnit -> List of IType			Map nonAbstractSubclassesMap= createNonAbstractSubclassesMapping(new SubProgressMonitor(pm, 1));			ICompilationUnit[] cus= getCompilationUnitsOfSubclassesOfTargetClass(new SubProgressMonitor(pm, 1));			IProgressMonitor subPm= new SubProgressMonitor(pm, 1);			subPm.beginTask("", cus.length*6); //$NON-NLS-1$			ICompilationUnit targetCu= getTargetCU();			for (int i= 0; i < cus.length; i++) {				ICompilationUnit cu= cus[i];				if (! needsRewriting(cu, membersToDeleteMap, nonAbstractSubclassesMap)) {					subPm.worked(6);					continue;				}					CompilationUnit cuNode= cu.equals(declaringCu) ? declaringCuNode : new RefactoringASTParser(AST.JLS3).parse(cu, true);				OldASTRewrite rewrite= new OldASTRewrite(cuNode);				if (membersToDeleteMap.containsKey(cu)){					List members= (List) membersToDeleteMap.get(cu);					deleteDeclarationNodes(cuNode, rewrite, members);				}				if (cu.equals(targetCu)){ 					if (shouldMakeTargetClassAbstract())						makeTargetClassAbstract(rewrite, cuNode);					copyMembersToTargetClass(declaringCuNode, cuNode, rewrite, new SubProgressMonitor(subPm, 1), status);					createAbstractMethodsInTargetClass(cuNode, declaringCuNode, rewrite, new SubProgressMonitor(subPm, 1), status);				} else{					subPm.worked(2);				}									if (cu.equals(declaringCu)){					increaseVisibilityOfMethodsDeclaredAbstract(rewrite, cuNode, new SubProgressMonitor(subPm, 2), status);				} else{					subPm.worked(2);				}									if (nonAbstractSubclassesMap.containsKey(cu)){					List subclasses= (List)nonAbstractSubclassesMap.get(cu);					addMethodStubsToNonAbstractSubclassesOfTargetClass(subclasses, cuNode, declaringCuNode, rewrite, new SubProgressMonitor(subPm, 2), status);				}				addTextEditFromRewrite(manager, cu, rewrite);				if (subPm.isCanceled())					throw new OperationCanceledException();			}			subPm.done();			return manager;		} finally{			pm.done();		}	}