--- old/src/macosx/native/sun/awt/CGraphicsDevice.m 2012-07-18 16:29:46.000000000 +0400 +++ new/src/macosx/native/sun/awt/CGraphicsDevice.m 2012-07-18 16:29:45.000000000 +0400 @@ -68,6 +68,11 @@ // One of the key parameters does not match continue; } + + if (refrate == 0) { // REFRESH_RATE_UNKNOWN + return cRef; + } + // Refresh rate might be 0 in display mode and we ask for specific display rate // but if we do not find exact match then 0 refresh rate might be just Ok if (CGDisplayModeGetRefreshRate(cRef) == refrate) { @@ -165,7 +170,10 @@ } } }]; + } else { + [JNFException raise:env as:kIllegalArgumentException reason:"Invalid display mode"]; } + CFRelease(allModes); JNF_COCOA_EXIT(env); }