Skip to content

Commit e8f7135

Browse files
committed
[ignore] Small code cleanup
1 parent a6610f4 commit e8f7135

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

exist-core/src/main/java/org/exist/storage/recovery/RecoveryManager.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public boolean recover() throws LogException {
149149
// if the last checkpoint record is not the last record in the file
150150
// we need a recovery.
151151
if ((lastCheckpoint == null || !lastCheckpoint.getLsn().equals(lastLsn)) &&
152-
txnsStarted.size() > 0) {
152+
!txnsStarted.isEmpty()) {
153153
LOG.info("Dirty transactions: {}", txnsStarted.size());
154154
// starting recovery: reposition the log reader to the last checkpoint
155155
if (lastCheckpoint == null) {
@@ -298,7 +298,7 @@ private void doRecovery(final int txnCount, final Path last, final JournalReader
298298
{
299299
LOG.info("Second pass: undoing dirty transactions. Uncommitted transactions: {}", runningTxns.size());}
300300
// see if there are uncommitted transactions pending
301-
if (runningTxns.size() > 0) {
301+
if (!runningTxns.isEmpty()) {
302302
// do a reverse scan of the log, undoing all uncommitted transactions
303303
try {
304304
final long lastSize = FileUtils.sizeQuietly(last);
@@ -307,9 +307,10 @@ private void doRecovery(final int txnCount, final Path last, final JournalReader
307307
if (next.getLogType() == LogEntryTypes.TXN_START) {
308308
if (runningTxns.get(next.getTransactionId()) != null) {
309309
runningTxns.remove(next.getTransactionId());
310-
if (runningTxns.size() == 0)
310+
if (runningTxns.isEmpty()) {
311311
// all dirty transactions undone
312-
{break;}
312+
break;
313+
}
313314
}
314315
} else if (next.getLogType() == LogEntryTypes.TXN_COMMIT) {
315316
// ignore already committed transaction

0 commit comments

Comments
 (0)