-
Bug
-
Resolution: Duplicate
-
P2
-
8u20, 8u25, 9
This is basically an 8u20 mirror of JDK-8055822
For example, the following code throws ClassCastException if run v.s. 8u20b26 (GA) with -Djava.awt.headless=true or even if DISPLAY variable is not set
Tested on Linux
--------------------------------------------------------------------
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.FlavorMap;
import java.awt.datatransfer.SystemFlavorMap;
import java.util.List;
public class SystemFlavorMapTest {
public static void main(String[] args) {
FlavorMap fm = SystemFlavorMap.getDefaultFlavorMap();
SystemFlavorMap sfm = (SystemFlavorMap)fm;
final List<DataFlavor> flavorsForNative = sfm.getFlavorsForNative("not-for-sure/registered-before");
System.err.println("flavorsForNative = " + flavorsForNative);
}
}
--------------------------------------------------------------------
The following tests which exist in _JCK8_
api/java_awt/datatransfer/DataFlavor/index.html#rclass
api/java_awt/datatransfer/SystemFlavorMap/index.html#GetF4N
api/java_awt/datatransfer/SystemFlavorMap/index.html#SetF4N
api/java_awt/datatransfer/SystemFlavorMap/index.html#SetN4F
fail.
See JCK-7303484 for the test logs
This is likely a regression introduced by JDK-8037202
For example, the following code throws ClassCastException if run v.s. 8u20b26 (GA) with -Djava.awt.headless=true or even if DISPLAY variable is not set
Tested on Linux
--------------------------------------------------------------------
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.FlavorMap;
import java.awt.datatransfer.SystemFlavorMap;
import java.util.List;
public class SystemFlavorMapTest {
public static void main(String[] args) {
FlavorMap fm = SystemFlavorMap.getDefaultFlavorMap();
SystemFlavorMap sfm = (SystemFlavorMap)fm;
final List<DataFlavor> flavorsForNative = sfm.getFlavorsForNative("not-for-sure/registered-before");
System.err.println("flavorsForNative = " + flavorsForNative);
}
}
--------------------------------------------------------------------
The following tests which exist in _JCK8_
api/java_awt/datatransfer/DataFlavor/index.html#rclass
api/java_awt/datatransfer/SystemFlavorMap/index.html#GetF4N
api/java_awt/datatransfer/SystemFlavorMap/index.html#SetF4N
api/java_awt/datatransfer/SystemFlavorMap/index.html#SetN4F
fail.
See JCK-7303484 for the test logs
This is likely a regression introduced by JDK-8037202
- duplicates
-
JDK-8051588 [headless] DataTransferer.getInstance throws ClassCastException in headless mode
- Resolved
- relates to
-
JDK-8051588 [headless] DataTransferer.getInstance throws ClassCastException in headless mode
- Resolved