Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318607

Summary: [ltk] RefactoringParticipant methods declare throws OperationCanceledExeption: exception gets logged
Product: [Eclipse Project] JDT Reporter: Karen Butzke <karenfbutzke>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: deepakazad, markus.kell.r, Szymon.Brandys
Version: 3.6   
Target Milestone: 3.7 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Karen Butzke CLA 2010-07-01 10:26:55 EDT
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.
Comment 1 Markus Keller CLA 2010-07-01 11:22:25 EDT
That's bad. Has been like this forever though (bug 116223, bug 63155), so I'm just going to fix it for 3.7, given that you already have a workaround.
Comment 2 Markus Keller CLA 2010-07-02 08:48:11 EDT
Created attachment 173299 [details]
Fix
Comment 3 Markus Keller CLA 2010-07-02 08:49:00 EDT
Fixed in HEAD.
Comment 4 Karen Butzke CLA 2010-07-02 09:56:11 EDT
Thanks for fixing this so quickly, Markus! Looks good to me, checked it out from head