Community
Participate
Working Groups
If the debugUI plugin has not already been loaded into the workspace, the ShowInConsoleAction does NOTHING at all. While the DebugUI plugin *is* set to load when any one of its classes are referenced, the lazy classloading mechanism in eclipse means that the code referencing a DebugUI class is never reached. The code currently is as follows: protected void selectProcess(IProcess process) { IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager(); IConsole[] consoles = consoleManager.getConsoles(); /* NOTE: If DebugUI is not loaded yet, this console array is EMPTY */ int size = consoles.length; IConsole console = null; for (int i = 0; i < size; i++) { /* NOTE: This is where a DebugUI class is first loaded */ if (consoles[i] instanceof org.eclipse.debug.ui.console.IConsole) { org.eclipse.debug.ui.console.IConsole con = (org.eclipse.debug.ui.console.IConsole) consoles[i]; if (process.equals(con.getProcess())) console = consoles[i]; } } As you can see, the first time the eclipse classloader would find a DebugUI class is inside a for-loop, which is never reached if DebugUI isn't already loaded. The fix is to reference this DebugUI class immediately inside the method. As follows: protected void selectProcess(IProcess process) { Class forceLoad = org.eclipse.debug.ui.console.IConsole.class; // etc... This will force DebugUI to load immediately before searching for the proper console.
Annoying that this actually happens with lazy loading, and thanks for providing the fix. I went with calling org.eclipse.debug.ui.console.IConsole.class.toString instead because not using the variable caused a compile warning in my workspace. ;-) Released to WTP 3.1 builds.
A small change is required here that was overlooked. Bug caught by Ravi Sankar. From the email: ------------- If the console view is already open, then the show in console action from the server view doesn't work. There is just a one liner fix for it. In the class "ShowInConsoleAction", method selectProcess -> from line 89 onwards, if (part != null) { page.activate(part); IConsoleView view = (IConsoleView) part.getAdapter(IConsoleView.class); if (view != null) { view.setFocus(); view.display(console); } } Adding the line in bold will fix it. Thanks, Ravi. --- Note: The line in bold is page.activate(part);
Fix released to 3.1 builds.
Closing old bugs.
New Gerrit change created: https://git.eclipse.org/r/108689
New Gerrit change created: https://git.eclipse.org/r/108780