I chose to extract a method (replace temp with query). After extracting the method I ran into the same weird editor state we've seen before (where selecting the extracted text shifts it around - it had something to do with invalid newline characters). Also I was unable to hit Ctrl+z to undo the refactoring.
Here's what the error log had:
eclipse.buildId=unknown
java.version=1.6.0
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.sdk.ide -pdelaunch
Command-line arguments: -product org.eclipse.sdk.ide -data C:\Users\Chris Williams\workspace\aptana-ide/../runtime-EclipseApplication -dev file:C:/Users/Chris
Williams/workspace/aptana-ide/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -pdelaunch -debug C:\Users\Chris Williams\workspace\aptana-ide\.metadata\.plugins\org.eclipse.pde.core\Eclipse Application/.options -os win32 -ws win32 -arch x86 -clean
Error
Tue May 29 11:09:11 EDT 2007
While undoing the operation, an exception occurred
org.eclipse.core.commands.ExecutionException: While undoing the operation, an exception occurred
at org.eclipse.core.commands.operations.DefaultOperationHistory.doUndo(DefaultOperationHistory.java:429)
at org.eclipse.core.commands.operations.DefaultOperationHistory.undo(DefaultOperationHistory.java:1244)
at org.eclipse.ui.operations.UndoActionHandler.runCommand(UndoActionHandler.java:66)
at org.eclipse.ui.operations.OperationHistoryActionHandler$4.run(OperationHistoryActionHandler.java:279)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:369)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:313)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:479)
at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog.access$6(TimeTriggeredProgressMonitorDialog.java:1)
at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog$2.run(TimeTriggeredProgressMonitorDialog.java:203)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog.run(TimeTriggeredProgressMonitorDialog.java:216)
at org.eclipse.ui.operations.OperationHistoryActionHandler.run(OperationHistoryActionHandler.java:289)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:461)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:424)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:160)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:466)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:799)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:846)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:564)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:506)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:122)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:982)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:927)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:965)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:961)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1275)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3346)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3246)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1932)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
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.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.IllegalArgumentException: Argument not valid
at org.eclipse.swt.SWT.error(SWT.java:3358)
at org.eclipse.swt.SWT.error(SWT.java:3297)
at org.eclipse.swt.SWT.error(SWT.java:3268)
at org.eclipse.jface.text.DefaultDocumentAdapter.getOffsetAtLine(DefaultDocumentAdapter.java:222)
at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:728)
at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:673)
at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:200)
at org.eclipse.swt.custom.StyledTextRenderer.calculateClientArea(StyledTextRenderer.java:218)
at org.eclipse.swt.custom.StyledText.resetCache(StyledText.java:6269)
at org.eclipse.swt.custom.StyledText.reset(StyledText.java:6263)
at org.eclipse.swt.custom.StyledText.handleTextSet(StyledText.java:5346)
at org.eclipse.swt.custom.StyledText$6.textSet(StyledText.java:4771)
at org.eclipse.jface.text.DefaultDocumentAdapter.fireTextSet(DefaultDocumentAdapter.java:359)
at org.eclipse.jface.text.DefaultDocumentAdapter.resumeForwardingDocumentChanges(DefaultDocumentAdapter.java:403)
at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:4509)
at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:4495)
at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:4618)
at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:4590)
at org.eclipse.jface.text.TextViewerUndoManager$DocumentUndoListener.documentUndoNotification(TextViewerUndoManager.java:173)
at org.eclipse.text.undo.DocumentUndoManager.fireDocumentUndo(DocumentUndoManager.java:927)
at org.eclipse.text.undo.DocumentUndoManager$UndoableCompoundTextChange.undo(DocumentUndoManager.java:470)
at org.eclipse.core.commands.operations.DefaultOperationHistory.doUndo(DefaultOperationHistory.java:413)
... 55 more