eclipse-platform / eclipse.platform.swt

Eclipse SWT
https://www.eclipse.org/swt/
Eclipse Public License 2.0
118 stars 139 forks source link

NPE in TextLayout.drawInPixels #1275

Open jukzi opened 5 months ago

jukzi commented 5 months ago

failure in Ibuild https://download.eclipse.org/eclipse/downloads/drops4/I20240611-1800/testresults/html/org.eclipse.jface.text.tests_ep433I-unit-cen64-gtk3-java22_linux.gtk.x86_64_22.html

Cannot read field "cairo" because "data" is null

java.lang.NullPointerException: Cannot read field "cairo" because "data" is null
at org.eclipse.swt.graphics.TextLayout.drawInPixels(TextLayout.java:646)
at org.eclipse.swt.graphics.TextLayout.drawInPixels(TextLayout.java:597)
at org.eclipse.swt.graphics.TextLayout.drawInPixels(TextLayout.java:568)
at org.eclipse.swt.graphics.TextLayout.draw(TextLayout.java:564)
at org.eclipse.jface.internal.text.TableOwnerDrawSupport.performPaint(TableOwnerDrawSupport.java:201)
at org.eclipse.jface.internal.text.TableOwnerDrawSupport.handleEvent(TableOwnerDrawSupport.java:96)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5855)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1617)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1643)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1626)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1373)
at org.eclipse.jface.internal.text.contentassist.CompletionTableDrawSupportTest.testPaintNonFocusSelectionInFocusColors(CompletionTableDrawSupportTest.java:85)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)

there is no recent commit in the stacktrace but nearby: cbda3bc3e702e6f3cbcac9042b0b46439b0454b0

fedejeanne commented 5 months ago

@jukzi thank you for reporting this. The failure may indeed be related to the changes introduced in https://github.com/eclipse-platform/eclipse.platform.ui/pull/1690. Sadly I don't have time to dig into it. Maybe @Christopher-Hermann or @BeckerWdf can investigate it and provide a fix?

Christopher-Hermann commented 5 months ago

I'm not sure if the PR will solve this issue. It's hard to test since I'm on MacOS and there everything works.