changeset 10173:5e205645d990

7124363: [macosx] ClassCastException: CFileDialog cannot be cast to LWWindowPeer Reviewed-by: anthony, serb
author pchelko
date Wed, 02 Oct 2013 11:18:17 +0400
parents a0c28e64c049
children 1189f954d52f
files src/macosx/classes/sun/lwawt/LWWindowPeer.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Tue Oct 01 18:40:35 2013 +0400
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Wed Oct 02 11:18:17 2013 +0400
@@ -393,8 +393,12 @@
     @Override
     public void setModalBlocked(Dialog blocker, boolean blocked) {
         synchronized (getPeerTreeLock()) {
-            this.blocker = !blocked ? null :
-            (LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer(blocker);
+            ComponentPeer peer =  AWTAccessor.getComponentAccessor().getPeer(blocker);
+            if (blocked && (peer instanceof LWWindowPeer)) {
+                this.blocker = (LWWindowPeer) peer;
+            } else {
+                this.blocker = null;
+            }
         }
 
         platformWindow.setModalBlocked(blocked);