Bug 466766 - [Cocoa] NPE in Composite._getChildren
Summary: [Cocoa] NPE in Composite._getChildren
Status: CLOSED DUPLICATE of bug 520488
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.4   Edit
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2015-05-07 13:47 EDT by Thomas Singer CLA
Modified: 2020-12-01 07:03 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Singer CLA 2015-05-07 13:47:18 EDT
For SmartGit we sometimes, but relatively rarely get following exception reported when showing the preferences dialog on OS X 10.9 or 10.10:

java.lang.NullPointerException
	at org.eclipse.swt.widgets.Composite._getChildren(Composite.java:95)
	at org.eclipse.swt.widgets.Composite.setTabGroupFocus(Composite.java:1107)
	at org.eclipse.swt.widgets.Control.traverseGroup(Control.java:4884)
	at org.eclipse.swt.widgets.Shell.windowDidBecomeKey(Shell.java:2161)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5675)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:214)
	at org.eclipse.swt.widgets.Widget.becomeKeyWindow(Widget.java:366)
	at org.eclipse.swt.widgets.Shell.becomeKeyWindow(Shell.java:525)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5499)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSWindow.makeKeyAndOrderFront(NSWindow.java:202)
	at org.eclipse.swt.widgets.Shell.makeKeyAndOrderFront(Shell.java:1291)
	at org.eclipse.swt.widgets.Shell.setWindowVisible(Shell.java:1972)
	at org.eclipse.swt.widgets.Shell.open(Shell.java:1349)

Unfortunately, I don't have a test snippet to reproduce.
Comment 1 Thomas Singer CLA 2018-04-16 04:48:30 EDT
Same happens with SWT 4.7, but a different stacktrace:

java.lang.NullPointerException
	at org.eclipse.swt.widgets.Composite._getChildren(Composite.java:96)
	at org.eclipse.swt.widgets.Composite.reskinChildren(Composite.java:976)
	at org.eclipse.swt.widgets.ToolBar.reskinChildren(ToolBar.java:705)
	at org.eclipse.swt.widgets.Widget.reskin(Widget.java:416)
	at org.eclipse.swt.widgets.Widget.setData(Widget.java:1694)
Comment 2 Lakshmi P Shanmugam CLA 2018-12-21 02:07:23 EST
Does this problem still happen with 4.9 or 4.10?
Comment 3 Thomas Singer CLA 2019-03-06 07:31:16 EST
Sorry for the very late answer. According to our records this issue was last reported against SWT 4.922 with this stacktrace:

java.lang.NullPointerException
	at org.eclipse.swt.widgets.Composite._getChildren(Composite.java:99)
	at org.eclipse.swt.widgets.Composite.reskinChildren(Composite.java:979)
	at org.eclipse.swt.widgets.ToolBar.reskinChildren(ToolBar.java:716)
	at org.eclipse.swt.widgets.Widget.reskin(Widget.java:423)
	at org.eclipse.swt.widgets.Widget.setData(Widget.java:1704)
	at ourcode
Comment 4 Thomas Singer CLA 2020-11-09 03:38:43 EST
The last stacktrace is reported 100% reliably reproducible for a user on macOS 11 beta with SmartSVN 14 which uses SWT 4940r7.
Comment 5 Lakshmi P Shanmugam CLA 2020-11-09 05:07:28 EST
(In reply to Thomas Singer from comment #4)
> The last stacktrace is reported 100% reliably reproducible for a user on
> macOS 11 beta with SmartSVN 14 which uses SWT 4940r7.

Can you please post the most recent stack trace (with line numbers)?
Comment 6 Thomas Singer CLA 2020-11-09 07:47:24 EST
The stacktrace is

java.lang.NullPointerException
	at org.eclipse.swt.widgets.Composite._getChildren(Composite.java:99)
	at org.eclipse.swt.widgets.Composite.reskinChildren(Composite.java:979)
	at org.eclipse.swt.widgets.ToolBar.reskinChildren(ToolBar.java:716)
	at org.eclipse.swt.widgets.Widget.reskin(Widget.java:423)
	at org.eclipse.swt.widgets.Widget.setData(Widget.java:1704)
Comment 7 Lakshmi P Shanmugam CLA 2020-11-10 03:48:14 EST
(In reply to Thomas Singer from comment #6)
> The stacktrace is
> 
> java.lang.NullPointerException
> 	at org.eclipse.swt.widgets.Composite._getChildren(Composite.java:99)
> 	at org.eclipse.swt.widgets.Composite.reskinChildren(Composite.java:979)
> 	at org.eclipse.swt.widgets.ToolBar.reskinChildren(ToolBar.java:716)
> 	at org.eclipse.swt.widgets.Widget.reskin(Widget.java:423)
> 	at org.eclipse.swt.widgets.Widget.setData(Widget.java:1704)

From the stack trace, looks like this is already fixed by Bug 520488 in 4.14.
Comment 8 Thomas Singer CLA 2020-11-10 07:33:37 EST
Hmm, the sent stacktrace is from v4940r7 which is ~1 year younger than commit 53d45085 (Bug 520488 - [cocoa] If a child Shell disposes its parent, parent throws
NPE).
Comment 9 Thomas Singer CLA 2020-11-11 09:01:48 EST
You may be right. Looking at the line numbers the stacktrace is not from the expected SWT build.
Comment 10 Lakshmi P Shanmugam CLA 2020-12-01 07:03:19 EST
(In reply to Thomas Singer from comment #9)
> You may be right. Looking at the line numbers the stacktrace is not from the
> expected SWT build.

Closing, please reopen if problem appears again.

*** This bug has been marked as a duplicate of bug 520488 ***