Community
Participate
Working Groups
Steps to reproduce the bug: * Run the class provided at the end of this report (any application (workbench or standalone) that uses the draw2d ScrollPane figure would do) * "Tickle" one of the ScrollBars a little - try clicking an holding the mouse button in the area between one of the arrows and the dragable bar, so that the view scrolls to its bound, then use the same technique to scroll to the other bound. Repeat. * After a while (rarely longer that, say, 20 seconds of "tickling") the scroll bar "sticks" to one of the boundaries and keeps scrolling that way whatever you do... Furthermore: * Now when you resize the window so that the viewport is large enough to contain its whole contents and the scrollbar(s) disappear, an exception is raised (the contents of stderr follows): org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:148) at org.eclipse.swt.widgets.Display.syncExec(Display.java:1640) at com.ibm.etools.draw2d.ButtonModel$1.run(ButtonModel.java:396) at com.ibm.etools.draw2d.util.Timer.preformRun(Timer.java:38) at com.ibm.etools.draw2d.util.Timer.run(Timer.java:54) at java.lang.Thread.run(Thread.java:484) org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at Bug.main(Bug.java:47) *** Stack trace of contained exception *** java.lang.NullPointerException at com.ibm.etools.draw2d.ButtonModel$2.run(ButtonModel.java:399) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at Bug.main(Bug.java:47) * If you make the window smaller again, the scrollbars will reappear and will work corretly (however, you may reproduce the bug over and over again) I succeeded to reproduce the bug everytime I intended to (even several times I didn't mean to do so, of course). The bug doesn't seem to occur on the SWT ScrolledComposite control. I use the version of GEF currently downloadable from http://download.eclipse.org/tools/gef/gef.zip _____ A minimal ScrollPane example: import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import com.ibm.etools.draw2d.LightweightSystem; import com.ibm.etools.draw2d.RectangleFigure; import com.ibm.etools.draw2d.ScrollPane; public class Bug { public static void main(String[] args) { Shell shell = new Shell(); LightweightSystem lws = new LightweightSystem(shell); RectangleFigure rectangle = new RectangleFigure(); rectangle.setPreferredSize(400, 300); ScrollPane scrollPane = new ScrollPane(); scrollPane.setView(rectangle); lws.setContents(scrollPane); shell.setText("ScrollPane problem"); shell.pack(); shell.open(); Display display = Display.getDefault(); while (!shell.isDisposed()) { try { if (!display.readAndDispatch()) { display.sleep(); } } catch (RuntimeException re) { re.printStackTrace(); } } } }
Thanks for the report. I believe this is already fixed in the "current" code. We will soon be making our current code available. The problem had to do with the pressed and armed properties changing state, and "resume" being called on the firing behavior unnecessarily, which spawned an extra Timer thread. Eventually we should change this to be "threadless" and use the timer function added to Display post V1 SWT.
Can you reproduce this using the latest download for GEF, which was uploaded several weeks ago?
fixed