Project: Eclipse_Platform_UI
Bug 167668 [Viewers] Changing logical structures using the Show Structure As.. menu breaks view
Reported: 2006-12-12 10:57:09 | Status: verified fixed

When stopped at a breakpoint and viewing logical structures I used the Show Structure As... menu item to change to a custom structure and variables would disappear leading to the following exception: org.eclipse.core.runtime.AssertionFailedException: null argument: at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:84) at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:72) at org.eclipse.jface.viewers.AbstractTreeViewer.getTreePathFromItem(AbstractTreeViewer.java:2667) at org.eclipse.jface.viewers.TreeViewer.virtualLazyUpdateWidget(TreeViewer.java:937) at org.eclipse.jface.viewers.TreeViewer.access$2(TreeViewer.java:933) at org.eclipse.jface.viewers.TreeViewer$2.handleEvent(TreeViewer.java:325) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1097) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1121) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1106) at org.eclipse.swt.widgets.Tree.checkData(Tree.java:317) at org.eclipse.swt.widgets.Tree.cellDataProc(Tree.java:252) at org.eclipse.swt.widgets.Display.cellDataProc(Display.java:663) at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method) at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:5533) at org.eclipse.swt.widgets.Display.eventProc(Display.java:1154) at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method) at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1472) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2896) 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.core.launcher.Main.invokeFramework(Main.java:339) at org.eclipse.core.launcher.Main.basicRun(Main.java:283) at org.eclipse.core.launcher.Main.run(Main.java:984) at org.eclipse.core.launcher.Main.main(Main.java:959) Steps to reproduce: 1. create a custom logical structure MyStruct for type List and simply make it return toArray() 2. debug the following code snippet 3. turn on logical structures 4. expand list[0] and select fName 5. right-click 'list' and use Show Structure As to show as MyStruct...boom Sometimes only the labels disappear for fName and this$0, sometimes the whole item vanishes, and sometimes the item won't disappear until you mouse over it. Code snippet: public static void main(String[] args) { Clazz clzz = new Clazz(); ArrayList<Var> list = new ArrayList<Var>(); list.add(clzz.new Var("one")); list.add(clzz.new Var("two")); list.add(clzz.new Var("three")); list.add(clzz.new Var("four")); list.add(clzz.new Var("five")); //BREAKPOINT for(Var num : list) { System.err.println(num.getName()); } }

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewer.java