Community
Participate
Working Groups
After activating breadcrumb view by resizing debug view, the tree selection will be lost. When attempting to copy breadcrumb contents using keyboard short-cut (CTRL-C on windows) will end up with a NPE dialog. Note that this is not reproducible by invoking "Copy Stack" action from pop-up menu as this will create a tree selection. Stack trace: java.lang.NullPointerException at org.eclipse.jface.viewers.CustomHashtable.hashCode(CustomHashtable.java:264) at org.eclipse.jface.viewers.CustomHashtable.get(CustomHashtable.java:236) at org.eclipse.jface.viewers.TreeSelection$InitializeData.<init>(TreeSelection.java:60) at org.eclipse.jface.viewers.TreeSelection$InitializeData.<init>(TreeSelection.java:52) at org.eclipse.jface.viewers.TreeSelection.<init>(TreeSelection.java:97) at org.eclipse.jface.viewers.TreeSelection.<init>(TreeSelection.java:108) at org.eclipse.debug.internal.ui.views.launch.LaunchViewCopyToClipboardActionDelegate.getPrunedSelection(LaunchViewCopyToClipboardActionDelegate.java:34) at org.eclipse.debug.internal.ui.viewers.model.VirtualCopyToClipboardActionDelegate.run(VirtualCopyToClipboardActionDelegate.java:98) at org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate.runWithEvent(AbstractDebugActionDelegate.java:313) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241) at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) .....
Created attachment 191744 [details] Proposed fix. Contract with TreeSelection constructor is to pass null for an empty selection. This is the reason of the jface NPE. Refactor handling of empty selection to not need to create an empty TreeSelection object
Hi Mike, I'd like to commit this for RC1, if it's still open. The fix is safe in that it only affects the narrow breadcrumb scenario.
Updated priority to reflect that the bug affects our product.
Created attachment 195113 [details] Original patch. I wrote almost identical solution before I found this bug.
+1 patch works fine
Thanks Mike, I committed the change.