void (final Transferable oldTransferable, final Transferable newTransferable) { Application application = getApplication(); if (application == null || application.isReadAccessAllowed()) { updateByTransferable(oldTransferable); updateByTransferable(newTransferable); } else { application.runReadAction(() -> { updateByTransferable(oldTransferable); updateByTransferable(newTransferable); }); } }