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

Bug 187265

Summary: [refactoring] strange OperationCancelledException in Introduce Indirection
Product: [Eclipse Project] JDT Reporter: Eric Jodet <eric_jodet>
Component: UIAssignee: Benno Baumgartner <benno.baumgartner>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.3Flags: martinae: review+
markus.kell.r: review+
Target Milestone: 3.3 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
[screen shot] refactor - adjusting...
none
[screen shot] error msg
none
fix none

Description Eric Jodet CLA 2007-05-16 10:16:52 EDT
Version: 3.3.0
Build id: I20070516-0010
Sun JRE 1.6

Test case as described in bug 186749
Wait until "Adjusting visibility" is displayed in the progress monitor.
Click the cancel button.

--> a strange error msg is displayed - click OK, the dialog disappear

(I'll attach screen shots)
Comment 1 Eric Jodet CLA 2007-05-16 10:17:39 EDT
Created attachment 67405 [details]
[screen shot] refactor - adjusting...
Comment 2 Eric Jodet CLA 2007-05-16 10:18:34 EDT
Created attachment 67409 [details]
[screen shot] error msg
Comment 3 Martin Aeschlimann CLA 2007-05-16 10:23:24 EDT
we should catch and handle the OperationCancelledException correctly
Comment 4 Benno Baumgartner CLA 2007-05-21 06:50:47 EDT
Created attachment 67965 [details]
fix
Comment 5 Benno Baumgartner CLA 2007-05-21 06:51:44 EDT
The patch also makes the cancel request a less sluggish. 
Comment 6 Martin Aeschlimann CLA 2007-05-22 04:14:29 EDT
Patch is good. Markus, can you do the second review?
Comment 7 Markus Keller CLA 2007-05-24 08:35:39 EDT
Problem for Exception in log was that cancellation was not checked before executing change, and during change execution, cancelling is not supported.

Released patch with a comment in PerformChangeOperation and filed bug 188892 for further issues.

Error in log was:

org.eclipse.core.runtime.CoreException: Exception does not provide a detail message
at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:100)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:211)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
org.eclipse.core.runtime.CoreException[4]: org.eclipse.core.runtime.OperationCanceledException
at org.eclipse.ltk.core.refactoring.CompositeChange.isValid(CompositeChange.java:243)
at org.eclipse.jdt.internal.corext.refactoring.changes.DynamicValidationStateChange.isValid(DynamicValidationStateChange.java:86)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:299)
at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.access$1(UIPerformChangeOperation.java:1)
at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation$1.run(UIPerformChangeOperation.java:66)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation$2.run(UIPerformChangeOperation.java:84)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3650)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3287)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:158)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:326)
at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:310)
at org.eclipse.ltk.ui.refactoring.RefactoringWizard.internalPerformFinish(RefactoringWizard.java:553)
at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.performFinish(UserInputWizardPage.java:154)
at org.eclipse.jdt.internal.ui.refactoring.IntroduceIndirectionInputPage.performFinish(IntroduceIndirectionInputPage.java:228)
at org.eclipse.ltk.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:619)
at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.okPressed(RefactoringWizardDialog2.java:439)
Comment 8 Benno Baumgartner CLA 2007-05-29 05:52:01 EDT
verified in I20070527-0010