-
Backport
-
Resolution: Fixed
-
P3
-
None
-
b01
-
Verified
[description copied from #6864370]
Platform - JDK6, JDK6u14, Solaris
JCK: 6b
If executed with -Dawt.toolkit=sun.awt.motif.MToolkit the following minimized test fails on Solaris:
import static java.awt.Dialog.ModalityType.*;
import static java.awt.Dialog.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
for (ModalityType modalityType : new ModalityType[] {
MODELESS, DOCUMENT_MODAL, APPLICATION_MODAL, TOOLKIT_MODAL} ) {
Dialog dialog = new Dialog((Frame) null);
dialog.setModalityType(modalityType);
Dialog.ModalityType expectedType;
boolean modalityTypeSupported = Toolkit.getDefaultToolkit().isModalityTypeSupported(modalityType);
System.out.println( modalityType + " supported: " + modalityTypeSupported);
if (!modalityTypeSupported) {
expectedType = Dialog.ModalityType.MODELESS;
} else {
expectedType = modalityType;
}
ModalityType returned = dialog.getModalityType();
if (expectedType != returned) {
System.out.println("Test failed. Expected : " + expectedType + ", returned: " + returned);
}
}
}
}
The following JCK tests fail due to this problem:
api/java_awt/Dialog/index.html#NewModalityTests[constructor_13]
api/java_awt/Dialog/index.html#NewModalityTests[constructor_14]
api/java_awt/Dialog/index.html#NewModalityTests[modalityTypeGetSet]
api/javax_swing/JDialog/index.html#NewModalityTests[constructor_04]
Platform - JDK6, JDK6u14, Solaris
JCK: 6b
If executed with -Dawt.toolkit=sun.awt.motif.MToolkit the following minimized test fails on Solaris:
import static java.awt.Dialog.ModalityType.*;
import static java.awt.Dialog.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
for (ModalityType modalityType : new ModalityType[] {
MODELESS, DOCUMENT_MODAL, APPLICATION_MODAL, TOOLKIT_MODAL} ) {
Dialog dialog = new Dialog((Frame) null);
dialog.setModalityType(modalityType);
Dialog.ModalityType expectedType;
boolean modalityTypeSupported = Toolkit.getDefaultToolkit().isModalityTypeSupported(modalityType);
System.out.println( modalityType + " supported: " + modalityTypeSupported);
if (!modalityTypeSupported) {
expectedType = Dialog.ModalityType.MODELESS;
} else {
expectedType = modalityType;
}
ModalityType returned = dialog.getModalityType();
if (expectedType != returned) {
System.out.println("Test failed. Expected : " + expectedType + ", returned: " + returned);
}
}
}
}
The following JCK tests fail due to this problem:
api/java_awt/Dialog/index.html#NewModalityTests[constructor_13]
api/java_awt/Dialog/index.html#NewModalityTests[constructor_14]
api/java_awt/Dialog/index.html#NewModalityTests[modalityTypeGetSet]
api/javax_swing/JDialog/index.html#NewModalityTests[constructor_04]
- backport of
-
JDK-6520635 isModalityTypeSupported is not handled correctly
- Closed