Project: clover
Issue CLOV-1614: Error when closing Cloud Editor in Eclipse
Closing the "Cloud Editor" in Eclipse causes that sometimes an exception is thrown and reported in the Error Log: {noformat} Error disposing widget for : org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl Clover Coverage Cloud Report java.lang.NullPointerException org.eclipse.swt.custom.CTabFolderLayout.computeSize(CTabFolderLayout.java:39) org.eclipse.swt.widgets.Composite.computeSize(Composite.java:234) org.eclipse.swt.layout.GridData.computeSize(GridData.java:491) org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:221) org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:197) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1290) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1276) org.eclipse.swt.widgets.Composite.layout(Composite.java:665) org.eclipse.swt.custom.CTabFolder.runUpdate(CTabFolder.java:3755) org.eclipse.swt.custom.CTabItem.getBounds(CTabItem.java:149) org.eclipse.swt.custom.CTabFolder.onPaint(CTabFolder.java:1993) org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:289) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070) org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1491) org.eclipse.swt.widgets.Control.windowProc(Control.java:4667) org.eclipse.swt.widgets.Display.windowProc(Display.java:5036) org.eclipse.swt.internal.win32.OS.VtblCall(Native Method) org.eclipse.swt.internal.ole.win32.IOleInPlaceObject.InPlaceDeactivate(IOleInPlaceObject.java:21) {noformat} and {noformat} Unhandled event loop exception java.lang.NullPointerException org.eclipse.swt.custom.CTabFolderLayout.computeSize(CTabFolderLayout.java:39) org.eclipse.swt.widgets.Composite.computeSize(Composite.java:234) org.eclipse.swt.layout.GridData.computeSize(GridData.java:491) org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:221) org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:197) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1290) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1297) org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1276) org.eclipse.swt.widgets.Composite.setLayoutDeferred(Composite.java:1087) org.eclipse.swt.widgets.Display.runDeferredLayouts(Display.java:4196) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754) org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) {noformat} Apparently, it fails in the CTabFolderLayout.computeSize() method: {code:java} protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { CTabFolder folder = (CTabFolder)composite; CTabFolderRenderer renderer = folder.renderer; ... tabW = Math.max(tabW, renderer.computeSize(width, 2, gc, -1, -1).x); {code} the 'renderer' is null. This renderer is being set in CTabFolder.init() method and set to null in the CTabFolder.onDispose() method. It *may* be related with the: CloudEditor.dispose() which calls removeCoverageChangeListener after the super.dispose() so a refresh event may come in the meantinme or CloudEditor.createPages() which "hacks" the container layout by changing it from FillLayout to GridLayout.
Story points: 3