GetNativesForFlavorTest.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:openjdk-jdk10 作者:
/**
 * Verifies that the encoded native is not added if there are other
 * natives mapped to this DataFlavor.
 */
public static void test1() throws ClassNotFoundException {
    final DataFlavor flavor =
            new DataFlavor("text/plain-TEST; charset=Unicode");

    final java.util.List natives = fm.getNativesForFlavor(flavor);

    if (natives.size() > 1) {
        for (final Iterator i = natives.iterator(); i.hasNext(); ) {
            String element = (String) i.next();
            if (SystemFlavorMap.isJavaMIMEType(element)) {
                throw new RuntimeException("getFlavorsForNative() returns: "
                        + natives);
            }
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号