Transferable () { Transferable transferable = doGetContents(); if (transferable != null && myFullTransferable != null && transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) { try { String stringData = (String) transferable.getTransferData(DataFlavor.stringFlavor); if (stringData.equals(myFullTransferable.getFirst())) { return myFullTransferable.getSecond(); } } catch (UnsupportedFlavorException | IOException e) { LOG.info(e); } } myFullTransferable = null; return transferable; }