Refactor File DnD (and assume that "java.io.IOException: Owner failed to convert data" is normal during the DnD process and can be ignored)

This commit is contained in:
Reinhard Pointner 2019-02-17 19:11:30 +07:00
parent a4c3ac9faa
commit 9fb947bbfd
2 changed files with 1 additions and 2 deletions

View File

@ -89,7 +89,7 @@ public class FileTransferable implements Transferable {
return isFileListFlavor(flavor);
}
public static <T> T getTransferData(Transferable tr, DataFlavor flavor, Class<T> type) throws IOException, UnsupportedFlavorException {
public static <T> T getTransferData(Transferable tr, DataFlavor flavor, Class<T> type) throws IOException, UnsupportedFlavorException, InvalidDnDOperationException {
Object transferData;
try {
transferData = tr.getTransferData(flavor);

View File

@ -27,7 +27,6 @@ public abstract class TransferablePolicy {
// *after* the drop has been accepted, but canImport is called before that
// just assume that the transferable will be accepted, accept will be called in importData again anyway
debug.log(Level.FINEST, e::toString);
return true;
} catch (Exception e) {
debug.log(Level.WARNING, e, e::getMessage);