Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ public final IDocument getCurrentDocument(IProgressMonitor monitor) throws CoreE
releaseDocument(result, subMon.newChild(1));
}
}
subMon.done();
if (result == null) {
result= new Document();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,18 @@ public void setSchedulingRule(ISchedulingRule rule) {
@Override
public void run(IProgressMonitor pm) throws CoreException {
SubMonitor subMon= SubMonitor.convert(pm, 4);
try {
fChangeExecuted= false;
if (createChange()) {
// Check for cancellation before executing the change, since canceling
// during change execution is not supported
// (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=187265 ):
fCreateChangeOperation.run(subMon.split(3));
fChange= fCreateChangeOperation.getChange();
if (fChange != null) {
executeChange(subMon.newChild(1));
}
} else {
executeChange(subMon.newChild(4));
fChangeExecuted= false;
if (createChange()) {
// Check for cancellation before executing the change, since canceling
// during change execution is not supported
// (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=187265 ):
fCreateChangeOperation.run(subMon.split(3));
fChange= fCreateChangeOperation.getChange();
if (fChange != null) {
executeChange(subMon.newChild(1));
}
} finally {
subMon.done();
} else {
executeChange(subMon.newChild(4));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ public void run(IProgressMonitor monitor) throws CoreException {
fUndo= perform.getUndoChange();
}
} finally {
subMon.done();
if (fRefactoringContext != null) {
fRefactoringContext.dispose();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ public RefactoringStatus checkAllConditions(IProgressMonitor pm) throws CoreExce
if (!result.hasFatalError()) {
result.merge(checkFinalConditions(subMon.split(refactoringTickProvider.getCheckFinalConditionsTicks())));
}
subMon.done();
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ public Change perform(IProgressMonitor pm) throws CoreException {
throw Changes.asCoreException(e);
} finally {
releaseDocument(document, subMon.newChild(1));
subMon.done();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;

Expand Down Expand Up @@ -123,11 +122,7 @@ public RefactoringStatus check(IProgressMonitor pm) throws CoreException {
SubMonitor sm= SubMonitor.convert(pm, "", values.size()); //$NON-NLS-1$
for (IConditionChecker checker : values) {
result.merge(checker.check(sm.split(1)));
if (pm.isCanceled()) {
throw new OperationCanceledException();
}
}
pm.done();
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@ public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreEx
if (result.hasFatalError()) {
return result;
}
if (sm.isCanceled()) {
throw new OperationCanceledException();
}

SharableParticipants sharableParticipants= new SharableParticipants(); // must not be shared when checkFinalConditions is called again
RefactoringParticipant[] loadedParticipants= getProcessor().loadParticipants(result, sharableParticipants);
Expand Down Expand Up @@ -270,9 +267,6 @@ public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreEx

stats.endRun();

if (sm2.isCanceled()) {
throw new OperationCanceledException();
}
}
if (result.hasFatalError()) {
return result;
Expand All @@ -292,9 +286,6 @@ public Change createChange(IProgressMonitor pm) throws CoreException {
try {
SubMonitor sm= SubMonitor.convert(pm, RefactoringCoreMessages.ProcessorBasedRefactoring_create_change, fParticipants.size() * 2 + 1);
Change processorChange= getProcessor().createChange(sm.split(1));
if (sm.isCanceled()) {
throw new OperationCanceledException();
}

fTextChangeMap= new HashMap<>();
addToTextChangeMap(processorChange);
Expand Down Expand Up @@ -334,9 +325,6 @@ public Change createChange(IProgressMonitor pm) throws CoreException {
disableParticipant(participant, e);
throw e;
}
if (sm.isCanceled()) {
throw new OperationCanceledException();
}
}

fTextChangeMap= null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ private Set<IProject> searchAndImportChildrenProjectsRecursively(final IContaine
for (CrawlFolderJob job : jobs) {
job.join(0, subMonitor.split(1));
}
subMonitor.done();
return res;
}

Expand Down Expand Up @@ -512,7 +511,6 @@ private Set<IProject> importProjectAndChildrenRecursively(final IContainer conta
// make sure this folder isn't going to be processed again
excludedPaths.add(project.getLocation());
}
subMonitor.done();
return projectFromCurrentContainer;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,14 @@ private static boolean saveModels(ISaveablesSource modelSource, final IWorkbench
IRunnableWithProgress progressOp = monitor -> {
IProgressMonitor monitorWrap = new EventLoopProgressMonitor(monitor);
SubMonitor subMonitor = SubMonitor.convert(monitorWrap, WorkbenchMessages.Save, dirtyModels.size());
try {
for (Saveable model : dirtyModels) {
// handle case where this model got saved as a result of
// saving another
if (!model.isDirty()) {
subMonitor.worked(1);
continue;
}
doSaveModel(model, subMonitor.split(1), window, confirm);
if (subMonitor.isCanceled()) {
break;
}
for (Saveable model : dirtyModels) {
// handle case where this model got saved as a result of
// saving another
if (!model.isDirty()) {
subMonitor.worked(1);
continue;
}
} finally {
monitorWrap.done();
doSaveModel(model, subMonitor.split(1), window, confirm);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,11 +796,7 @@ public boolean saveModels(final List<Saveable> finalModels, final IShellProvider
continue;
}
SaveableHelper.doSaveModel(model, subMonitor.split(1), shellProvider, blockUntilSaved);
if (subMonitor.isCanceled()) {
break;
}
}
monitorWrap.done();
};

// Do the save.
Expand Down
Loading