Community
Participate
Working Groups
We have received a couple of exceptions from different users on Big Sur (SWT 4940r7): java.lang.NullPointerException at org.eclipse.swt.widgets.ToolBar.layoutUnified(SourceFile:588) at org.eclipse.swt.widgets.ToolBar.layout(SourceFile:655) at org.eclipse.swt.widgets.ToolBar.relayout(SourceFile:674) at org.eclipse.swt.widgets.ToolBar.createItem(SourceFile:301) at org.eclipse.swt.widgets.ToolItem.<init>(SourceFile:98) Unfortunately, no snippet or details how to reproduce.
Apparently, this bug can be reproduced in our SWT-based app every single time when trying to open a "main window" (with a unified toolbar). The stack trace and source code lines are exactly as in the original report. Not yet sure if it can be reproduced in a more recent SWT version.
(In reply to Stephan Aßmus from comment #1) > Apparently, this bug can be reproduced in our SWT-based app every single > time when trying to open a "main window" (with a unified toolbar). The stack > trace and source code lines are exactly as in the original report. Not yet > sure if it can be reproduced in a more recent SWT version. Sorry, I meant to add the crucial bit of information that this happens in macOS Monterey.
(In reply to Stephan Aßmus from comment #2) > (In reply to Stephan Aßmus from comment #1) > > Apparently, this bug can be reproduced in our SWT-based app every single > > time when trying to open a "main window" (with a unified toolbar). The stack > > trace and source code lines are exactly as in the original report. Not yet > > sure if it can be reproduced in a more recent SWT version. > > Sorry, I meant to add the crucial bit of information that this happens in > macOS Monterey. Can you pls provide a test case to reproduce the problem? Does it also happen on Big Sur?
It does not happen on Big Sur. Meanwhile, I have confirmed that it still happens with SWT 4.21. I should be able to provide a minimal test case, since it happens while preparing the toolbar in a specific way, before any items are added.
Created attachment 287454 [details] Test-case Eclipse project for reproducing the crash. Import into Eclipse workspace, have SWT as "org.eclipse.swt" in the workspace along the test-case project, run Main class as Java application. Should work on Big Sur and crash on Monterrey.
For easy browsing: https://github.com/stippi/swt-unified-toolbar-crash
Meanwhile, I have updated the example project on GitHub (linked above) with more self-explanatory stuff in the UI and JavaDocs and so on. For feedback on TrimArea and perhaps an alternative way to achieve the same thing, I would be very grateful.
I can confirm this bug also using my application. Only happens if a unified toolbar is used and only in MacOS Monterey.