List<VcsException> (AbstractVcs vcs, TransactionRunnable runnable, Object vcsParameters) { List<VcsException> exceptions = new ArrayList<>(); TransactionProvider transactionProvider = vcs.getTransactionProvider(); boolean transactionSupported = transactionProvider != null; if (transactionSupported) { transactionProvider.startTransaction(vcsParameters); } runnable.run(exceptions); if (transactionSupported) { if (exceptions.isEmpty()) { try { transactionProvider.commitTransaction(vcsParameters); } catch (VcsException e) { exceptions.add(e); transactionProvider.rollbackTransaction(vcsParameters); } } else { transactionProvider.rollbackTransaction(vcsParameters); } } return exceptions; }