From 412187e8db17d3d29364267bf2e9b29d3afe829c Mon Sep 17 00:00:00 2001 From: Hammy Date: Mon, 19 Jul 2021 02:08:19 +0100 Subject: [PATCH] De-generify exception names --- src/main/java/me/goudham/ClipboardListener.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/me/goudham/ClipboardListener.java b/src/main/java/me/goudham/ClipboardListener.java index 7a84237..fef33bd 100644 --- a/src/main/java/me/goudham/ClipboardListener.java +++ b/src/main/java/me/goudham/ClipboardListener.java @@ -1,10 +1,8 @@ package me.goudham; import java.awt.Toolkit; -import java.awt.datatransfer.Clipboard; -import java.awt.datatransfer.ClipboardOwner; -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.*; +import java.io.IOException; public class ClipboardListener extends Thread implements ClipboardOwner { @@ -18,9 +16,8 @@ public class ClipboardListener extends Thread implements ClipboardOwner { @Override public void lostOwnership(Clipboard c, Transferable t) { try { - System.out.println("Sleeping for 200 milliseconds"); sleep(200); - } catch (Exception ignored) { } + } catch (InterruptedException ignored) { } Transferable contents = c.getContents(currentThread()); processContents(contents); @@ -34,7 +31,7 @@ public class ClipboardListener extends Thread implements ClipboardOwner { if (entryListener != null) { entryListener.onCopy(what); } - } catch (Exception ignored) { } + } catch (UnsupportedFlavorException | IOException ignored) { } } public void regainOwnership(Clipboard c, Transferable t) {