Skip to content

NPE in TextLayout.drawInPixels #1275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jukzi opened this issue Jun 12, 2024 · 2 comments
Open

NPE in TextLayout.drawInPixels #1275

jukzi opened this issue Jun 12, 2024 · 2 comments
Assignees
Labels
bug Something isn't working junit JUnit test failure Linux/GTK Happens on Linux

Comments

@jukzi
Copy link
Contributor

jukzi commented Jun 12, 2024

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
Copy link
Contributor

@jukzi thank you for reporting this. The failure may indeed be related to the changes introduced in eclipse-platform/eclipse.platform.ui#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 added a commit to Christopher-Hermann/eclipse.platform.ui that referenced this issue Jun 12, 2024
The workbench colors will not always be initialized in the JFace area, for example if the workbench is not started. To make sure there are no NPE, the system colors are used as default.

Fixes eclipse-platform#1955, eclipse-platform/eclipse.platform.swt#1275
@Christopher-Hermann
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working junit JUnit test failure Linux/GTK Happens on Linux
Projects
None yet
Development

No branches or pull requests

4 participants