HBASE-19239 Fix findbugs and error-prone issues

Fixes for hbase-prefix-tree
This commit is contained in:
Andrew Purtell 2017-11-15 18:47:45 -08:00
parent 5b7411290b
commit 24feb1ab75
3 changed files with 3 additions and 3 deletions

View File

@ -186,7 +186,7 @@ public class RowSectionWriter {
ArrayList<TokenizerNode> outs = Lists.newArrayList();
for (int i = ins.size() - 1; i >= 0; --i) {
TokenizerNode n = ins.get(i);
if (n.isLeaf() && leaves || (!n.isLeaf() && !leaves)) {
if ((n.isLeaf() && leaves) || (!n.isLeaf() && !leaves)) {
outs.add(ins.get(i));
}
}

View File

@ -312,7 +312,7 @@ public class TokenizerNode{
public void appendNodesToExternalList(List<TokenizerNode> appendTo, boolean includeNonLeaves,
boolean includeLeaves) {
if (includeNonLeaves && !isLeaf() || includeLeaves && isLeaf()) {
if ((includeNonLeaves && !isLeaf()) || (includeLeaves && isLeaf())) {
appendTo.add(this);
}
for (int i = 0; i < children.size(); ++i) {

View File

@ -72,7 +72,7 @@ public class UFIntTool {
public static void writeBytes(int outputWidth, final long value, byte[] bytes, int offset) {
bytes[offset + outputWidth - 1] = (byte) value;
for (int i = outputWidth - 2; i >= 0; --i) {
bytes[offset + i] = (byte) (value >>> (outputWidth - i - 1) * 8);
bytes[offset + i] = (byte) (value >>> ((outputWidth - i - 1) * 8));
}
}