7124363: [macosx] ClassCastException: CFileDialog cannot be cast to LWWindowPeer
Reviewed-by: anthony, serb
--- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java Tue Oct 01 18:40:35 2013 +0400
+++ b/jdk/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);