package io.atomix.storage.journal;
import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
import io.netty.buffer.ByteBufAllocator;
* @throws IllegalStateException if the segment manager is not open
*/
private void assertOpen() {
- checkState(currentSegment != null, "journal not open");
+ if (currentSegment == null) {
+ throw new IllegalStateException("journal not open");
+ }
}
/**
*/
package org.opendaylight.controller.cluster.access.commands;
-import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
import java.util.ArrayList;
}
private void checkNotFinished() {
- checkState(protocol == null, "Batch has already been finished");
+ if (protocol != null) {
+ throw new IllegalStateException("Batch has already been finished");
+ }
}
public ModifyTransactionRequestBuilder addModification(final TransactionModification modification) {
}
public ModifyTransactionRequestBuilder setSequence(final long sequence) {
- checkState(!haveSequence, "Sequence has already been set");
+ if (haveSequence) {
+ throw new IllegalStateException("Sequence has already been set");
+ }
this.sequence = sequence;
haveSequence = true;
return this;
}
public @NonNull ModifyTransactionRequest build() {
- checkState(haveSequence, "Request sequence has not been set");
+ if (!haveSequence) {
+ throw new IllegalStateException("Request sequence has not been set");
+ }
final ModifyTransactionRequest ret = new ModifyTransactionRequest(identifier, sequence, replyTo, modifications,
protocol);