Project: Eclipse_Platform_UI
Bug 205282 [Forms] BusyIndicator causes and swallows several exceptions
Reported: 2007-10-03 08:34:00 | Status: resolved fixed

Build ID: I20070921-0919 The new implementation of the BusyIndicator introduced in 3.4 M2 causes several exceptions, which, however, are swallowed in an empty catch block. You will catch these exceptions when Exception breakpoints for NPE and others are enabled. The problem obviously occurs when setBusy is called frequently. I have a search text field in my form in which every ModifyEvent triggers a new search, i.e. every character typed in will cause an update an therefore setBusy will be called in quick succession. If you have problems to reproduce the bug, I could try to cut my Forms code down to a small bug snippet. The exceptions thrown are as follows: org.eclipse.swt.SWTError: No more handles at org.eclipse.swt.SWT.error(SWT.java:3717) at org.eclipse.swt.SWT.error(SWT.java:3609) at org.eclipse.swt.SWT.error(SWT.java:3580) at org.eclipse.swt.graphics.Image.createGdipImage(Image.java:870) at org.eclipse.swt.graphics.GC.drawImage(GC.java:897) at org.eclipse.swt.graphics.GC.drawImage(GC.java:891) at org.eclipse.ui.internal.forms.widgets.BusyIndicator$2.run(BusyIndicator.java:123) java.lang.NullPointerException at org.eclipse.swt.graphics.Image.dispose(Image.java:1038) at org.eclipse.ui.internal.forms.widgets.BusyIndicator.clearImages(BusyIndicator.java:303) at org.eclipse.ui.internal.forms.widgets.BusyIndicator.access$0(BusyIndicator.java:299) at org.eclipse.ui.internal.forms.widgets.BusyIndicator$2.run(BusyIndicator.java:188) java.lang.NullPointerException at org.eclipse.swt.graphics.Image.createGdipImage(Image.java:865) at org.eclipse.swt.graphics.GC.drawImage(GC.java:897) at org.eclipse.swt.graphics.GC.drawImage(GC.java:891) at org.eclipse.ui.internal.forms.widgets.BusyIndicator$2.run(BusyIndicator.java:123) Exception in thread "Thread-72" java.lang.OutOfMemoryError: Java heap space at org.eclipse.swt.graphics.Image.getImageData(Image.java:1440) at org.eclipse.ui.internal.forms.widgets.BusyIndicator$2.run(BusyIndicator.java:122) Line 176 in org.eclipse.ui.internal.forms.widgets.BusyIndicator protected synchronized void createBusyThread() { ... busyThread = new Thread() { private Image timage; public void run() { try { ... } catch (Exception e) { <<< empty catch block swallows these exceptions } finally { ... } } ... }

Files changed in fix:
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BusyIndicator.java