Project: JDT
Bug 318607 [ltk] RefactoringParticipant methods declare throws OperationCanceledExeption: exception gets logged
Reported: 2010-07-01 10:26:55 | Status: resolved fixed

org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant.checkConditions() has a throws clause of OperationCanceledException. In my implementation of checkConditions() I check progressMonitor.isCanceled() and then throw the OperationCanceledException. ProcessorBasedRefactoring catches it and logs it, which just seems wrong to me. Of course the workaround is just to return null instead of throwing the OperationCanceledException. RefactoringParticipant.createChange() has the same problem but worse. In this case my participant gets removed from the framework as a result of throwing the OperationCanceledException. I assume createPreChange() has the same issue.

Files changed in fix:
org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/participants/CancelingParticipantTests.java org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/participants/ParticipantTests.java org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/participants/ProcessorBasedRefactoring.java