mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-155785 Lots of IllegalStateException: cannot open system clipboard in the log
This commit is contained in:
@@ -123,16 +123,15 @@ public class ClipboardSynchronizer implements ApplicationComponent {
|
||||
myClipboardHandler.resetContent();
|
||||
}
|
||||
|
||||
private static boolean isWClipboardProblemLogged = false;
|
||||
@Nullable
|
||||
private static Clipboard getClipboard() {
|
||||
try {
|
||||
//sun.awt.windows.WClipboard may throw an IllegalStateException
|
||||
return Toolkit.getDefaultToolkit().getSystemClipboard();
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (!isWClipboardProblemLogged) {
|
||||
isWClipboardProblemLogged = true;
|
||||
catch (IllegalStateException e) {
|
||||
if (SystemInfo.isWindows) {
|
||||
LOG.debug("Clipboard is busy");
|
||||
} else {
|
||||
LOG.warn(e);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user