public static <E> E handleClipboardSafely(@NotNull Supplier<? extends E> supplier, E defaultValue) {
    ThrowableComputable<E, RuntimeException> task = () -> {
      try {
        return supplier.get();
      }
      catch (IllegalStateException e) {
        if (SystemInfo.isWindows) {
          LOG.debug("Clipboard is busy");
        }
        else {
          LOG.warn(e);
        }
      }
      catch (NullPointerException e) {
        LOG.warn("Java bug #6322854", e);
      }
      catch (IllegalArgumentException e) {
        LOG.warn("Java bug #7173464", e);
      }
      return defaultValue;
    };
    return ApplicationManager.getApplication().isDispatchThread()
           ? (IdeEventQueue.getInstance().isDispatchingOnMainThread ? task.compute() : waitOnEdtWithTimeout(task, defaultValue))
           : DiskQueryRelay.compute(task);
  }
public static <E> E handleClipboardSafely(@NotNull Supplier<? extends E> supplier, E defaultValue)