Community
Participate
Working Groups
I20040727 I tried to extract a local variable in a method that had syntax errors. I was prompted with a dilaog saying "This file contains syntax errors. To perform this operation you will need to fix the errors.". I pressed OK, and the dialog came back... again and again and again. I had to kill Eclipse to get out of the infinite prompting.
I re-started, fixed the error and did the replacement. Then I was prompted infinitely to do the replacement :-) Had to kill Eclipse again.
The problem is that the ExtractTempAction gets triggered in an end less loop. The root cause of the problem seems to be memonic translation in SWT. Somehow thi produces an end less loop. Th estack trace I see all the time is: Thread [main] (Suspended (breakpoint at line 659 in Window)) MessageDialog(Window).open() line: 659 MessageDialog.openInformation(Shell, String, String) line: 343 RefactoringWizardOpenOperation$1.run() line: 119 BusyIndicator.showWhile(Display, Runnable) line: 69 RefactoringWizardOpenOperation.run(Shell, String) line: 138 RefactoringStarter.activate(Refactoring, RefactoringWizard, Shell, String, boolean) line: 40 ExtractTempAction.run(ITextSelection) line: 93 ExtractTempAction(SelectionDispatchAction).dispatchRun(ISelection) line: 216 ExtractTempAction(SelectionDispatchAction).run() line: 188 ExtractTempAction(Action).runWithEvent(Event) line: 979 ActionHandler.execute(Map) line: 141 Command.execute(Map) line: 135 WorkbenchKeyboard.executeCommand(String) line: 476 WorkbenchKeyboard.press(List, Event) line: 899 WorkbenchKeyboard.processKeyEvent(List, Event) line: 940 WorkbenchKeyboard.filterKeySequenceBindings(Event) line: 554 WorkbenchKeyboard.access$2(WorkbenchKeyboard, Event) line: 501 WorkbenchKeyboard$1.handleEvent(Event) line: 267 EventTable.sendEvent(Event) line: 82 Display.filterEvent(Event) line: 740 ToolBar(Widget).sendEvent(Event) line: 795 ToolBar(Widget).sendEvent(int, Event, boolean) line: 820 ToolBar(Widget).sendEvent(int, Event) line: 805 ToolBar(Control).traverse(Event) line: 2723 ToolBar(Control).translateMnemonic(Event, Control) line: 2564 ToolBar(Composite).translateMnemonic(Event, Control) line: 540 CoolBar(Composite).translateMnemonic(Event, Control) line: 545 Composite.translateMnemonic(Event, Control) line: 545 CBanner(Composite).translateMnemonic(Event, Control) line: 545 Shell(Composite).translateMnemonic(Event, Control) line: 545 StyledText(Control).translateMnemonic(MSG) line: 2582 Display.translateMnemonic(MSG, Control) line: 3191 Display.filterMessage(MSG) line: 754 Display.readAndDispatch() line: 2427 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1435 Workbench.runUI() line: 1406 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 263 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 144 IDEApplication.run(Object) line: 102 PlatformActivator$1.run(Object) line: 335 EclipseStarter.run(Object) line: 273 EclipseStarter.run(String[], Runnable) line: 129 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 85 NativeMethodAccessorImpl.invoke(Method, Object, Object[]) line: 58 DelegatingMethodAccessorImpl.invoke(Method, Object, Object[]) line: 60 Method.invoke(Object, Object[]) line: 391 Main.basicRun(String[]) line: 183 Main.run(String[]) line: 644 Main.main(String[]) line: 628 and the loop happens in memonic translation code somewhere in CoolBar(Composite).translateMnemonic(Event, Control) line: 545 Composite.translateMnemonic(Event, Control) line: 545 CBanner(Composite).translateMnemonic(Event, Control) line: 545 Shell(Composite).translateMnemonic(Event, Control) line: 545 StyledText(Control).translateMnemonic(MSG) line: 2582
Steps to reproduce: public class A { public void foo() { int i= 10; bar } } select 10 and activate extract temp by pressing Alt+Shift+L. Doesn't happen when trigger from the menu. Happens with every action triggered in the editor using short cuts. This renders the build useless.
As another example press Alt+Shift+J having the cursor inside a method that doesn't have Javadoc. As a result you end up having lots of Javadoc comments. This loop terminates after some time. So item might not be an endless loop ;-).
*** Bug 71226 has been marked as a duplicate of this bug. ***
Talked to SSQ and MVM. The SWT.Traverse event for a mnemonic is sent to each control in the hierarchy so that custom controls can implement mnemonics. It seems that Eclipse is filtering on SWT.Traverse and seeing each individual event. Doesn't seem like an SWT problem.
It appears to have been introduced between org.eclipse.ui.workbench versions v20040726 AND v20040720, investigating.
This was introduced by a fix made for bug 64598.
*** Bug 71613 has been marked as a duplicate of this bug. ***
*** Bug 71704 has been marked as a duplicate of this bug. ***
This problem must be considered with respect to Bug 64598.
This problem appears to be specific to Windows XP. It does not occur on GTK+. In talking with Silenio, this is not expected behaviour. If doit is set to false, then the Traverse event should stop. The series of events our filter sees (on Windows XP): Alt+Shift+L (opens dialog) CR (closing dialog) CR CR Alt+Shift+L However, "Alt+Shift+L" was only pressed once. The fix for this bug is required before the fix for Bug 64598 can go in.
Ok, we talked again :-). The behavior is different between GTK and Window because the combination "alt+shift+XXX" is not a mnemonic on GTK but it is on Windows.
This bug is fixed. I will have to revisit Bug 64598 -- while paying attention to this possible problem.
Verified using the steps in comment #3 using 3.1 RC1.