Project: JDT
Bug 168847 [surround with] SurroundWithActionGroup waits for AST when building editor context menu
Reported: 2006-12-21 09:28:44 | Status: verified fixed

I20061219-1300 SurroundWithActionGroup waits for AST when building editor context menu. We must not wait for the AST while building the main editor context menu. "main" prio=6 tid=0x00036340 nid=0xda0 in Object.wait() [0x0007e000..0x0007fc40] at java.lang.Object.wait(Native Method) - waiting on <0x12d4dda0> (a java.lang.Object) at java.lang.Object.wait(Object.java:474) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:490) - locked <0x12d4dda0> (a java.lang.Object) at org.eclipse.jdt.internal.ui.text.correction.AssistContext.getASTRoot(AssistContext.java:70) at org.eclipse.jdt.internal.ui.text.correction.SurroundWith.getSelectedStatements(SurroundWith.java:170) at org.eclipse.jdt.internal.ui.text.correction.QuickTemplateProcessor.getAssists(QuickTemplateProcessor.java:120) at org.eclipse.jdt.internal.ui.actions.SurroundWithTemplateMenuAction.getTemplateActions(SurroundWithTemplateMenuAction.java:3 at org.eclipse.jdt.internal.ui.actions.SurroundWithTemplateMenuAction.fillMenu(SurroundWithTemplateMenuAction.java:162) at org.eclipse.jdt.internal.ui.actions.SurroundWithActionGroup.fillContextMenu(SurroundWithActionGroup.java:60) at org.eclipse.jdt.internal.ui.actions.CompositeActionGroup.fillContextMenu(CompositeActionGroup.java:78) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.editorContextMenuAboutToShow(CompilationUnitEditor.java:1336) at org.eclipse.ui.texteditor.AbstractTextEditor$13.menuAboutToShow(AbstractTextEditor.java:2486) at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:289) at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:394) at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:390) at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:416) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:117) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:933) at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:3681) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3398) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1554) at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1728) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4134) at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method) at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:227) at org.eclipse.swt.widgets.Display.runPopups(Display.java:3491) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3073) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1945) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1909) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:425) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:522) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:147) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:170) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:473) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:417) at org.eclipse.equinox.launcher.Main.run(Main.java:1121) at org.eclipse.equinox.launcher.Main.main(Main.java:1096)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/SurroundWithActionGroup.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/SurroundWithTemplateMenuAction.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickTemplateProcessor.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SurroundWith.java