提交 5fc2c062 编写于 作者: P pchelko

7184951: [macosx] Exception at java.awt.datatransfer on headless mode (only in GUI session)

Reviewed-by: art, anthony
上级 884e1998
......@@ -182,7 +182,11 @@ public class CDataTransferer extends DataTransferer {
Long format = predefinedClipboardNameMap.get(str);
if (format == null) {
format = new Long(registerFormatWithPasteboard(str));
if (java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance()) {
// Do not try to access native system for the unknown format
return -1L;
}
format = registerFormatWithPasteboard(str);
predefinedClipboardNameMap.put(str, format);
predefinedClipboardFormatMap.put(format, str);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册