Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix modernization issues
[controller.git]
/
opendaylight
/
md-sal
/
sal-akka-raft
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
raft
/
persisted
/
SimpleReplicatedLogEntry.java
diff --git
a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/SimpleReplicatedLogEntry.java
b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/SimpleReplicatedLogEntry.java
index 14ce5420d26081c06eed9a442e3dd39287c1c730..4c07e6b812e254ad026e6d49211e4e22b97f5b6b 100644
(file)
--- a/
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/SimpleReplicatedLogEntry.java
+++ b/
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/persisted/SimpleReplicatedLogEntry.java
@@
-5,10
+5,10
@@
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.controller.cluster.raft.persisted;
package org.opendaylight.controller.cluster.raft.persisted;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
@@
-39,7
+39,7
@@
public final class SimpleReplicatedLogEntry implements ReplicatedLogEntry, Seria
this.replicatedLogEntry = replicatedLogEntry;
}
this.replicatedLogEntry = replicatedLogEntry;
}
- static int estimatedSerializedSize(ReplicatedLogEntry replicatedLogEntry) {
+ static int estimatedSerializedSize(
final
ReplicatedLogEntry replicatedLogEntry) {
return 8 /* index */ + 8 /* term */ + replicatedLogEntry.getData().size()
+ 400 /* estimated extra padding for class info */;
}
return 8 /* index */ + 8 /* term */ + replicatedLogEntry.getData().size()
+ 400 /* estimated extra padding for class info */;
}
@@
-75,10
+75,10
@@
public final class SimpleReplicatedLogEntry implements ReplicatedLogEntry, Seria
* @param term the term
* @param payload the payload
*/
* @param term the term
* @param payload the payload
*/
- public SimpleReplicatedLogEntry(
long index, long term,
Payload payload) {
+ public SimpleReplicatedLogEntry(
final long index, final long term, final
Payload payload) {
this.index = index;
this.term = term;
this.index = index;
this.term = term;
- this.payload =
Preconditions.checkNot
Null(payload);
+ this.payload =
requireNon
Null(payload);
}
@Override
}
@Override
@@
-107,7
+107,7
@@
public final class SimpleReplicatedLogEntry implements ReplicatedLogEntry, Seria
}
@Override
}
@Override
- public void setPersistencePending(boolean pending) {
+ public void setPersistencePending(
final
boolean pending) {
persistencePending = pending;
}
persistencePending = pending;
}
@@
-130,7
+130,7
@@
public final class SimpleReplicatedLogEntry implements ReplicatedLogEntry, Seria
}
@Override
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(
final
Object obj) {
if (this == obj) {
return true;
}
if (this == obj) {
return true;
}