Commit 8dfa7397 authored by Patrick D. Hunt's avatar Patrick D. Hunt
Browse files

ZOOKEEPER-1981. Fix Dodgy Code Warnings identified by findbugs 2.0.3 (Hongchao Deng via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1612458 13f79535-47bb-0310-9956-ffa450edef68
parent 1d3550e8
......@@ -723,6 +723,9 @@ BUGFIXES:
ZOOKEEPER-1979. Fix Performance Warnings found by Findbugs 2.0.3
(Hongchao Deng via phunt)
ZOOKEEPER-1981. Fix Dodgy Code Warnings identified by findbugs 2.0.3
(Hongchao Deng via phunt)
IMPROVEMENTS:
ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,
......
......@@ -2493,6 +2493,9 @@ public class ZooKeeper {
rmReq.setType(watcherType.getIntValue());
request = rmReq;
break;
default:
LOG.warn("unknown type " + opCode);
break;
}
return request;
}
......
......@@ -696,6 +696,9 @@ public class PrepRequestProcessor extends ZooKeeperCriticalThread implements
request.setTxn(new CheckVersionTxn(path, checkAndIncVersion(nodeRecord.stat.getVersion(),
checkVersionRequest.getVersion(), path)));
break;
default:
LOG.warn("unknown type " + type);
break;
}
}
......@@ -843,6 +846,9 @@ public class PrepRequestProcessor extends ZooKeeperCriticalThread implements
zks.sessionTracker.checkSession(request.sessionId,
request.getOwner());
break;
default:
LOG.warn("unknown type " + request.type);
break;
}
} catch (KeeperException e) {
if (request.getHdr() != null) {
......
......@@ -676,8 +676,6 @@ public class FileTxnLog implements TxnLog {
crc.update(bytes, 0, bytes.length);
if (crcValue != crc.getValue())
throw new IOException(CRC_ERROR);
if (bytes == null || bytes.length == 0)
return false;
hdr = new TxnHeader();
record = SerializeUtils.deserializeTxn(bytes, hdr);
} catch (EOFException e) {
......
......@@ -276,6 +276,9 @@ public class AuthFastLeaderElection implements Election {
case 2:
ackstate = QuorumPeer.ServerState.FOLLOWING;
break;
default:
LOG.warn("unknown type " + responseBuffer.getInt());
break;
}
Vote current = self.getCurrentVote();
......@@ -698,6 +701,9 @@ public class AuthFastLeaderElection implements Election {
LOG.warn("Exception while sending ack: ", e);
}
break;
default:
LOG.warn("unknown type " + m.type);
break;
}
}
}
......
......@@ -163,6 +163,9 @@ public class Follower extends Learner{
case Leader.SYNC:
fzk.sync();
break;
default:
LOG.warn("unknown type " + qp.getType());
break;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment