These two are equivalent and using instanceof is more consistent with the rest
of the code.
Change-Id: I0493a94a09f66e19afb503afd05682692fba1b40
Signed-off-by: Robert Varga <rovarga@cisco.com>
ActorRef actorRef, RaftRPC rpc) throws Exception {
super.assertStateChangesToFollowerWhenRaftRPCHasNewerTerm(actorContext, actorRef, rpc);
ActorRef actorRef, RaftRPC rpc) throws Exception {
super.assertStateChangesToFollowerWhenRaftRPCHasNewerTerm(actorContext, actorRef, rpc);
- String expVotedFor = RequestVote.class.isInstance(rpc) ? ((RequestVote)rpc).getCandidateId() : null;
+ String expVotedFor = rpc instanceof RequestVote ? ((RequestVote)rpc).getCandidateId() : null;
assertEquals("New votedFor", expVotedFor, actorContext.getTermInformation().getVotedFor());
}
assertEquals("New votedFor", expVotedFor, actorContext.getTermInformation().getVotedFor());
}
try {
if (CreateTransaction.isSerializedType(message)) {
handleCreateTransaction(message);
try {
if (CreateTransaction.isSerializedType(message)) {
handleCreateTransaction(message);
- } else if (BatchedModifications.class.isInstance(message)) {
+ } else if (message instanceof BatchedModifications) {
handleBatchedModifications((BatchedModifications)message);
} else if (message instanceof ForwardedReadyTransaction) {
handleForwardedReadyTransaction((ForwardedReadyTransaction) message);
handleBatchedModifications((BatchedModifications)message);
} else if (message instanceof ForwardedReadyTransaction) {
handleForwardedReadyTransaction((ForwardedReadyTransaction) message);