vazexqi / CodingSpectator

Watches and analyzes code edits in the Eclipse IDE non-invasively
http://codingspectator.cs.illinois.edu
Other
20 stars 14 forks source link

UnsupportedOperationException while renaming a class. #118

Closed Wanderer777 closed 13 years ago

Wanderer777 commented 13 years ago

Trying to rename class edu.illinois.keshmesh.detector.tests.lck06j.LCK02JTests from the package explorer view, the dialog window did not react on 'Finish' and 'Cancel' clicks. This is the exception from the error log:

java.lang.UnsupportedOperationException
at org.eclipse.jdt.internal.corext.refactoring.rename.RenameCompilationUnitProcessor.createRefactoringDescriptor(RenameCompilationUnitProcessor.java:518)
at org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor$WatchedJavaRenameProcessor.createRefactoringDescriptor(JavaRenameProcessor.java:114)
at org.eclipse.jdt.internal.corext.refactoring.codingspectator.WatchedRenameProcessor.getSimpleRefactoringDescriptor(WatchedRenameProcessor.java:22)
at org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor.getSimpleRefactoringDescriptor(JavaRenameProcessor.java:98)
at org.eclipse.ltk.core.refactoring.participants.RenameRefactoring.getSimpleRefactoringDescriptor(RenameRefactoring.java:63)
at org.eclipse.ltk.core.refactoring.codingspectator.Logger.createRefactoringDescriptor(Logger.java:47)
at org.eclipse.ltk.core.refactoring.codingspectator.Logger.logRefactoringEvent(Logger.java:72)
at org.eclipse.ltk.ui.refactoring.RefactoringWizard.performCancel(RefactoringWizard.java:660)
at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.handleShellCloseEvent(RefactoringWizardDialog2.java:484)
at org.eclipse.jface.window.Window$3.shellClosed(Window.java:687)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:98)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations.java:308)
at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Decorations.java:1665)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4162)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2362)
at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:495)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4251)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2362)
at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:495)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4251)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:180)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:192)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:113)
at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:38)
at org.eclipse.jdt.internal.ui.refactoring.UserInterfaceStarter.activate(UserInterfaceStarter.java:62)
at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameUserInterfaceStarter.activate(RenameUserInterfaceStarter.java:31)
at org.eclipse.jdt.ui.refactoring.RenameSupport.openDialog(RenameSupport.java:162)
at org.eclipse.jdt.ui.refactoring.RenameSupport.openDialog(RenameSupport.java:120)
at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startRenameRefactoring(RefactoringExecutionStarter.java:457)
at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:227)
at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:117)
at org.eclipse.jdt.ui.actions.RenameAction.run(RenameAction.java:120)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
vazexqi commented 13 years ago

Can you paste the code sequence that triggered this? Or since it's in KeshMesh, can you send me the github URL to that file and indicate where you invoked the refactoring.

reprogrammer commented 13 years ago

I reproduced the problem on a Java project with a single class. If you try to rename the class from within the package explorer, you'll get the exception.

reprogrammer commented 13 years ago

Fixed the bug in e9303c1ee48e3382466bbdc0b19e687961b1c9d2.

reprogrammer commented 13 years ago

Forked the branch reorganize-watched-processors (a3e87c8fb35b391f65637319e77242b46a24a554 ) to reduce the complexity of watched processors.

vazexqi commented 13 years ago

Converted "pseudo" multiple-inheritance using inner classes to using simpler delegates in f9923a9e2507bbc1fa41e83f84b9b889899eb694

Please take a look to see if this is easier to understand. Also, please test this out more since I haven't done serious testing on it.

We should also still consider if we would like to merge/consolidate/split some of the interface hierarchies.