@Override public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException { pm.beginTask(RefactoringCoreMessages.ExtractConstantRefactoring_checking_preconditions, 2); /* Note: some checks are performed on change of input widget * values. (e.g. see ExtractConstantRefactoring.checkConstantNameOnChange()) */ //TODO: possibly add more checking for name conflicts that might // lead to a change in behavior try { RefactoringStatus result = new RefactoringStatus(); createConstantDeclaration(); replaceExpressionsWithConstant(); fChange = fCuRewrite.createChange(RefactoringCoreMessages.ExtractConstantRefactoring_change_name, true, new SubProgressMonitor(pm, 1)); if (fCheckResultForCompileProblems) { checkSource(new SubProgressMonitor(pm, 1), result); } return result; } finally { fConstantTypeCache = null; fCuRewrite.clearASTAndImportRewrites(); pm.done(); } }
@Override public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException { pm.beginTask(RefactoringCoreMessages.ExtractConstantRefactoring_checking_preconditions, 2); /* Note: some checks are performed on change of input widget * values. (e.g. see ExtractConstantRefactoring.checkConstantNameOnChange()) */ //TODO: possibly add more checking for name conflicts that might // lead to a change in behavior try { RefactoringStatus result= new RefactoringStatus(); createConstantDeclaration(); replaceExpressionsWithConstant(); fChange= fCuRewrite.createChange(RefactoringCoreMessages.ExtractConstantRefactoring_change_name, true, new SubProgressMonitor(pm, 1)); if (fCheckResultForCompileProblems) { checkSource(new SubProgressMonitor(pm, 1), result); } return result; } finally { fConstantTypeCache= null; fCuRewrite.clearASTAndImportRewrites(); pm.done(); } }
@Override public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException { pm.beginTask(RefactoringCoreMessages.ExtractConstantRefactoring_checking_preconditions, 2); /* Note: some checks are performed on change of input widget * values. (e.g. see ExtractConstantRefactoring.checkConstantNameOnChange()) */ //TODO: possibly add more checking for name conflicts that might // lead to a change in behavior try { RefactoringStatus result= new RefactoringStatus(); createConstantDeclaration(); replaceExpressionsWithConstant(); fChange= fCuRewrite.createChange(RefactoringCoreMessages.ExtractConstantRefactoring_change_name, true, new SubProgressMonitor(pm, 1)); if (fCheckResultForCompileProblems) { checkSource(new SubProgressMonitor(pm, 1), result); } return result; } finally { fConstantTypeCache= null; fCuRewrite.clearASTAndImportRewrites(); pm.done(); } }
fSelectionCuRewrite.clearASTAndImportRewrites(); fDeclarationCuRewrite.clearASTAndImportRewrites(); List<CompilationUnitChange>changes= new ArrayList<>(); HashSet<SimpleName> staticImportsInInitializer= new HashSet<>();
fSelectionCuRewrite.clearASTAndImportRewrites(); fDeclarationCuRewrite.clearASTAndImportRewrites(); List<CompilationUnitChange>changes= new ArrayList<>(); HashSet<SimpleName> staticImportsInInitializer= new HashSet<>();
monitor.beginTask(RefactoringCoreMessages.MoveInnerToTopRefactoring_creating_preview, 4); final Map<ICompilationUnit, CompilationUnitRewrite> rewrites= new HashMap<>(2); fSourceRewrite.clearASTAndImportRewrites(); rewrites.put(fSourceRewrite.getCu(), fSourceRewrite); final MemberVisibilityAdjustor adjustor= new MemberVisibilityAdjustor(fType.getPackageFragment(), fType); targetRewrite.clearASTAndImportRewrites(); createCompilationUnitRewrite(bindings, targetRewrite, typeReferences, constructorReferences, adjustor.getAdjustments().containsKey(fType), inputCU, unit, true, status, monitor);
monitor.beginTask(RefactoringCoreMessages.MoveInnerToTopRefactoring_creating_preview, 4); final Map rewrites= new HashMap(2); fSourceRewrite.clearASTAndImportRewrites(); rewrites.put(fSourceRewrite.getCu(), fSourceRewrite); final MemberVisibilityAdjustor adjustor= new MemberVisibilityAdjustor(fType.getPackageFragment(), fType); targetRewrite.clearASTAndImportRewrites(); createCompilationUnitRewrite(bindings, targetRewrite, typeReferences, constructorReferences, adjustor.getAdjustments().containsKey(fType), fType.getCompilationUnit(), unit, true, status, monitor);
monitor.beginTask(RefactoringCoreMessages.MoveInnerToTopRefactoring_creating_preview, 4); final Map<ICompilationUnit, CompilationUnitRewrite> rewrites= new HashMap<>(2); fSourceRewrite.clearASTAndImportRewrites(); rewrites.put(fSourceRewrite.getCu(), fSourceRewrite); final MemberVisibilityAdjustor adjustor= new MemberVisibilityAdjustor(fType.getPackageFragment(), fType); targetRewrite.clearASTAndImportRewrites(); createCompilationUnitRewrite(bindings, targetRewrite, typeReferences, constructorReferences, adjustor.getAdjustments().containsKey(fType), inputCU, unit, true, status, monitor);
fIntermediaryClassBinding= null; for (Iterator iter= fRewrites.values().iterator(); iter.hasNext();) ((CompilationUnitRewrite) iter.next()).clearASTAndImportRewrites();
fIntermediaryTypeBinding= null; for (Iterator<CompilationUnitRewrite> iter= fRewrites.values().iterator(); iter.hasNext();) iter.next().clearASTAndImportRewrites();
fIntermediaryTypeBinding= null; for (Iterator<CompilationUnitRewrite> iter= fRewrites.values().iterator(); iter.hasNext();) iter.next().clearASTAndImportRewrites();
monitor.beginTask("", 7); //$NON-NLS-1$ monitor.setTaskName(RefactoringCoreMessages.MoveInstanceMethodProcessor_creating); fSourceRewrite.clearASTAndImportRewrites(); final TextChangeManager manager= new TextChangeManager(); final CompilationUnitRewrite targetRewrite= fMethod.getCompilationUnit().equals(getTargetType().getCompilationUnit()) ? fSourceRewrite : new CompilationUnitRewrite(getTargetType().getCompilationUnit());
monitor.beginTask("", 7); //$NON-NLS-1$ monitor.setTaskName(RefactoringCoreMessages.MoveInstanceMethodProcessor_creating); fSourceRewrite.clearASTAndImportRewrites(); final TextChangeManager manager= new TextChangeManager(); final CompilationUnitRewrite targetRewrite= fMethod.getCompilationUnit().equals(getTargetType().getCompilationUnit()) ? fSourceRewrite : new CompilationUnitRewrite(getTargetType().getCompilationUnit());
RefactoringStatus result= new RefactoringStatus(); clearManagers(); fBaseCuRewrite.clearASTAndImportRewrites(); fBaseCuRewrite.getASTRewrite().setTargetSourceRangeComputer(new TightSourceRangeComputer());
RefactoringStatus result= new RefactoringStatus(); clearManagers(); fBaseCuRewrite.clearASTAndImportRewrites(); fBaseCuRewrite.getASTRewrite().setTargetSourceRangeComputer(new TightSourceRangeComputer());
RefactoringStatus result= new RefactoringStatus(); clearManagers(); fBaseCuRewrite.clearASTAndImportRewrites(); fBaseCuRewrite.getASTRewrite().setTargetSourceRangeComputer(new TightSourceRangeComputer());