@@ -149,7 +149,7 @@ public boolean recover() throws LogException {
149
149
// if the last checkpoint record is not the last record in the file
150
150
// we need a recovery.
151
151
if ((lastCheckpoint == null || !lastCheckpoint .getLsn ().equals (lastLsn )) &&
152
- txnsStarted .size () > 0 ) {
152
+ ! txnsStarted .isEmpty () ) {
153
153
LOG .info ("Dirty transactions: {}" , txnsStarted .size ());
154
154
// starting recovery: reposition the log reader to the last checkpoint
155
155
if (lastCheckpoint == null ) {
@@ -298,7 +298,7 @@ private void doRecovery(final int txnCount, final Path last, final JournalReader
298
298
{
299
299
LOG .info ("Second pass: undoing dirty transactions. Uncommitted transactions: {}" , runningTxns .size ());}
300
300
// see if there are uncommitted transactions pending
301
- if (runningTxns .size () > 0 ) {
301
+ if (! runningTxns .isEmpty () ) {
302
302
// do a reverse scan of the log, undoing all uncommitted transactions
303
303
try {
304
304
final long lastSize = FileUtils .sizeQuietly (last );
@@ -307,9 +307,10 @@ private void doRecovery(final int txnCount, final Path last, final JournalReader
307
307
if (next .getLogType () == LogEntryTypes .TXN_START ) {
308
308
if (runningTxns .get (next .getTransactionId ()) != null ) {
309
309
runningTxns .remove (next .getTransactionId ());
310
- if (runningTxns .size () == 0 )
310
+ if (runningTxns .isEmpty ()) {
311
311
// all dirty transactions undone
312
- {break ;}
312
+ break ;
313
+ }
313
314
}
314
315
} else if (next .getLogType () == LogEntryTypes .TXN_COMMIT ) {
315
316
// ignore already committed transaction
0 commit comments