Community
Participate
Working Groups
Using a Tree with the SWT.NO_SCROLL style bit leads to an NPE on resize and when adding new treeitems as the scrollbar is null. Snippet: Display display = new Display(); Shell shell = new Shell(display); Tree tree = new Tree(shell, SWT.NO_SCROLL); TreeItem treeItem= new TreeItem(tree, SWT.NONE); treeItem.setText(0, "foo"); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); Stacktrace: java.lang.NullPointerException at org.eclipse.swt.widgets.Tree.updateScrollBars(Tree.java:2217) at org.eclipse.swt.widgets.TreeItem.<init>(TreeItem.java:289) at org.eclipse.swt.widgets.TreeItem.<init>(TreeItem.java:131) at bug.App.start(App.java:20) at org.eclipse.rap.ui.internal.application.EntrypointApplicationWrapper.createUI(EntrypointApplicationWrapper.java:27) at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:92) at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:245) at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:114) at java.lang.Thread.run(Thread.java:619) at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)
Added a check for SWT.NO_SCROLL in Tree#updateScrollBars().