case READY:
throw new IllegalStateException("Attempted to preCommit in stage " + ready.stage);
default:
- throw new IllegalStateException("Unhandled commit stage " + ready.stage);
+ throwUnhandledCommitStage(ready);
}
}
case READY:
throw new IllegalStateException("Attempted to doCommit in stage " + ready.stage);
default:
- throw new IllegalStateException("Unhandled commit stage " + ready.stage);
+ throwUnhandledCommitStage(ready);
}
}
case PRE_COMMIT_PENDING:
throw new IllegalStateException("Attempted to canCommit in stage " + ready.stage);
default:
- throw new IllegalStateException("Unhandled commit stage " + ready.stage);
+ throwUnhandledCommitStage(ready);
}
}
});
break;
default:
- throw new IllegalStateException("Unhandled commit stage " + ready.stage);
+ throwUnhandledCommitStage(ready);
}
}
}
}
- private @Nullable TransactionSuccess<?> handleModifyTransaction(final ModifyTransactionRequest request,
+ @Nullable
+ private TransactionSuccess<?> handleModifyTransaction(final ModifyTransactionRequest request,
final RequestEnvelope envelope, final long now) throws RequestException {
// We need to examine the persistence protocol first to see if this is an idempotent request. If there is no
// protocol, there is nothing for us to do.
state);
return ((Sealed) state).sealedModification;
}
+
+ private static void throwUnhandledCommitStage(final Ready ready) {
+ throw new IllegalStateException("Unhandled commit stage " + ready.stage);
+ }
}