7042645: Numerous api/java_awt jck tests fail - AWT Assertion Failure on fastdebug ri bundles b138 win7 x86
authorssadetsky
Tue, 07 Apr 2015 16:07:20 +0400
changeset 30448 b963f710497d
parent 29899 a660cade22ce
child 30449 8638a0d1ce4d
7042645: Numerous api/java_awt jck tests fail - AWT Assertion Failure on fastdebug ri bundles b138 win7 x86 Reviewed-by: serb, azvegint
jdk/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp
jdk/src/java.desktop/windows/native/libawt/windows/awt_Checkbox.cpp
jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp	Mon Apr 06 10:35:59 2015 -0700
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp	Tue Apr 07 16:07:20 2015 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -242,7 +242,8 @@
         RECT focusRect;
         VERIFY(::CopyRect(&focusRect, &rect));
         VERIFY(::InflateRect(&focusRect,-inf,-inf));
-        VERIFY(::DrawFocusRect(hDC, &focusRect));
+        if(::DrawFocusRect(hDC, &focusRect) == 0)
+            VERIFY(::GetLastError() == 0);
     }
 
     /* Notify any subclasses */
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Checkbox.cpp	Mon Apr 06 10:35:59 2015 -0700
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Checkbox.cpp	Tue Apr 07 16:07:20 2015 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -290,12 +290,14 @@
     if ((drawInfo.itemState & ODS_FOCUS) &&
         ((drawInfo.itemAction & ODA_FOCUS)||
          (drawInfo.itemAction &ODA_DRAWENTIRE))) {
-        VERIFY(::DrawFocusRect(hDC, &focusRect));
+        if(::DrawFocusRect(hDC, &focusRect) == 0)
+            VERIFY(::GetLastError() == 0);
     }
     /*  erase focus rect */
     else if (!(drawInfo.itemState & ODS_FOCUS) &&
              (drawInfo.itemAction & ODA_FOCUS)) {
-        VERIFY(::DrawFocusRect(hDC, &focusRect));
+        if(::DrawFocusRect(hDC, &focusRect) == 0)
+            VERIFY(::GetLastError() == 0);
     }
 
     /*  Notify any subclasses */
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp	Mon Apr 06 10:35:59 2015 -0700
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp	Tue Apr 07 16:07:20 2015 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -4322,7 +4322,8 @@
     if ((drawInfo.itemState & ODS_FOCUS)  &&
         (drawInfo.itemAction & (ODA_FOCUS | ODA_DRAWENTIRE))) {
       if (!unfocusableChoice){
-          VERIFY(::DrawFocusRect(hDC, &rect));
+          if(::DrawFocusRect(hDC, &rect) == 0)
+              VERIFY(::GetLastError() == 0);
       }
     }
     env->DeleteLocalRef(target);