6961754: JCK tests CvsEventTest0001 and CvsEventTest0002 fail under FF 3.5 on OEL 5
authoranthony
Fri, 18 Jun 2010 17:13:26 +0400
changeset 5760 4177643566d5
parent 5759 6d02dbbc2974
child 5761 2a67809d309f
child 5941 1a56de1b70b3
6961754: JCK tests CvsEventTest0001 and CvsEventTest0002 fail under FF 3.5 on OEL 5 Summary: Check the return value of XlibUtil.translateCoordinates() for null Reviewed-by: art, dcherepanov
jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java
jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java	Fri Jun 18 17:09:28 2010 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java	Fri Jun 18 17:13:26 2010 +0400
@@ -275,7 +275,7 @@
         Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(),
                                                           XToolkit.getDefaultRootWindow(),
                                                           new Point(0, 0));
-        return absoluteLoc.x;
+        return absoluteLoc != null ? absoluteLoc.x : 0;
     }
 
     public int getAbsoluteY()
@@ -283,7 +283,7 @@
         Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(),
                                                           XToolkit.getDefaultRootWindow(),
                                                           new Point(0, 0));
-        return absoluteLoc.y;
+        return absoluteLoc != null ? absoluteLoc.y : 0;
     }
 
     public int getWidth() {
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Fri Jun 18 17:09:28 2010 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Fri Jun 18 17:13:26 2010 +0400
@@ -849,7 +849,7 @@
                     // if _NET_WM_STRUT_PARTIAL is present, we should use its values to detect
                     // if the struts area intersects with screenBounds, however some window
                     // managers don't set this hint correctly, so we just get intersection with windowBounds
-                    if (windowBounds.intersects(screenBounds))
+                    if (windowBounds != null && windowBounds.intersects(screenBounds))
                     {
                         insets.left = Math.max((int)Native.getLong(native_ptr, 0), insets.left);
                         insets.right = Math.max((int)Native.getLong(native_ptr, 1), insets.right);