Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1410 Exception at refactoring (Extract Method / Local Variable)

open
nobody
5
2011-10-21
2011-10-21
cwutte
No

I get the following exceptions when I want to use Extract Method or Extract Local Variable on both Eclipse Helios and Indigo with Pydev 2.2.3. (reinstalled it too):

Exception at Extract Method:
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275)
at org.eclipse.ui.internal.progress.ProgressManager$5.run(ProgressManager.java:960)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:995)
at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:970)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.checkInitialConditions(RefactoringWizardOpenOperation.java:205)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.access$0(RefactoringWizardOpenOperation.java:200)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:163)
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:115)
at org.python.pydev.refactoring.ui.core.PythonRefactoringWizard.run(PythonRefactoringWizard.java:57)
at org.python.pydev.refactoring.ui.actions.internal.AbstractRefactoringAction.run(AbstractRefactoringAction.java:87)
at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:289)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
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.Control.traverse(Control.java:3695)
at org.eclipse.swt.widgets.Control.translateMnemonic(Control.java:3537)
at org.eclipse.swt.widgets.Composite.translateMnemonic(Composite.java:1190)
at org.eclipse.swt.widgets.Control.translateMnemonic(Control.java:3555)
at org.eclipse.swt.widgets.Display.translateMnemonic(Display.java:4673)
at org.eclipse.swt.widgets.Display.filterMessage(Display.java:1267)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3653)
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:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
Caused by: java.lang.NullPointerException
at org.python.pydev.refactoring.coderefactoring.extractmethod.ExtractMethodRefactoring.checkInitialConditions(ExtractMethodRefactoring.java:72)
at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

eclipse.buildId=M20110210-1200
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: -os win32 -ws win32 -arch x86

Exception at Extract Local Variable (everytime a input a charecter in variable popup. The preview and ok buttons stay greyed out):
java.lang.RuntimeException: java.lang.RuntimeException: Cannot handle wild imports.
at org.python.pydev.refactoring.ast.visitors.VisitorFactory.createContextVisitor(VisitorFactory.java:93)
at org.python.pydev.refactoring.ast.adapters.AbstractScopeNode.getUsedVariables(AbstractScopeNode.java:71)
at org.python.pydev.refactoring.ast.adapters.AbstractScopeNode.alreadyUsedName(AbstractScopeNode.java:78)
at org.python.pydev.refactoring.core.validator.NameValidator.validateUniqueVariable(NameValidator.java:40)
at org.python.pydev.refactoring.coderefactoring.extractlocal.ExtractLocalRefactoring.checkVarName(ExtractLocalRefactoring.java:154)
at org.python.pydev.refactoring.ui.pages.extractlocal.ExtractLocalInputPage.validateTextField(ExtractLocalInputPage.java:94)
at org.python.pydev.refactoring.ui.pages.core.eclipse.TextInputWizardPage.textModified(TextInputWizardPage.java:161)
at org.python.pydev.refactoring.ui.pages.extractlocal.ExtractLocalInputPage.textModified(ExtractLocalInputPage.java:87)
at org.python.pydev.refactoring.ui.pages.core.eclipse.TextInputWizardPage$1.modifyText(TextInputWizardPage.java:136)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:173)
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:1058)
at org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:2526)
at org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:4299)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4165)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886)
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.Text.callWindowProc(Text.java:255)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4253)
at org.eclipse.swt.widgets.Text.windowProc(Text.java:2170)
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:115)
at org.python.pydev.refactoring.ui.core.PythonRefactoringWizard.run(PythonRefactoringWizard.java:57)
at org.python.pydev.refactoring.ui.actions.internal.AbstractRefactoringAction.run(AbstractRefactoringAction.java:87)
at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:289)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
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.Control.traverse(Control.java:3695)
at org.eclipse.swt.widgets.Control.translateMnemonic(Control.java:3537)
at org.eclipse.swt.widgets.Composite.translateMnemonic(Composite.java:1190)
at org.eclipse.swt.widgets.Control.translateMnemonic(Control.java:3555)
at org.eclipse.swt.widgets.Display.translateMnemonic(Display.java:4673)
at org.eclipse.swt.widgets.Display.filterMessage(Display.java:1267)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3653)
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:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
Caused by: java.lang.RuntimeException: Cannot handle wild imports.
at org.python.pydev.refactoring.ast.visitors.context.ScopeVariablesVisitor.visitImportFrom(ScopeVariablesVisitor.java:68)
at org.python.pydev.parser.jython.ast.ImportFrom.accept(ImportFrom.java:89)
at org.python.pydev.refactoring.ast.visitors.context.AbstractContextVisitor.visit(AbstractContextVisitor.java:171)
at org.python.pydev.refactoring.ast.visitors.context.ScopeVariablesVisitor.visit(ScopeVariablesVisitor.java:44)
at org.python.pydev.refactoring.ast.visitors.context.AbstractContextVisitor.visit(AbstractContextVisitor.java:179)
at org.python.pydev.refactoring.ast.visitors.context.ScopeVariablesVisitor.visitModule(ScopeVariablesVisitor.java:93)
at org.python.pydev.parser.jython.ast.Module.accept(Module.java:72)
at org.python.pydev.refactoring.ast.visitors.VisitorFactory.createContextVisitor(VisitorFactory.java:90)
... 76 more

Discussion