From e06ad08fd438f6070be2c0bf4e69a9178db67863 Mon Sep 17 00:00:00 2001 From: Anthony Petrov Date: Fri, 17 Apr 2009 16:16:14 +0400 Subject: [PATCH] 6826104: Getting a NullPointer exception when clicked on Application & Toolkit Modal dialog The addition of window peers to the windows collection has been restored in XWindowPeer. Reviewed-by: art, dcherepanov --- jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java index 41807dbf047..d3fb2107281 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java @@ -146,6 +146,13 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, params.put(OVERRIDE_REDIRECT, Boolean.valueOf(isOverrideRedirect())); + SunToolkit.awtLock(); + try { + windows.add(this); + } finally { + SunToolkit.awtUnlock(); + } + cachedFocusableWindow = isFocusableWindow(); Font f = target.getFont();