diff --git a/CHANGES.txt b/CHANGES.txt index 8a326a0ad15..9b9e5e1de5c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -284,6 +284,7 @@ Release 0.21.0 - Unreleased HBASE-2086 Job(configuration,String) deprecated (Kay Kay via Stack) HBASE-1996 Configure scanner buffer in bytes instead of number of rows (Erik Rozendaal and Dave Latham via Stack) + HBASE-2090 findbugs issues (Kay Kay via Stack) NEW FEATURES HBASE-1901 "General" partitioner for "hbase-48" bulk (behind the api, write diff --git a/src/java/org/apache/hadoop/hbase/client/Scan.java b/src/java/org/apache/hadoop/hbase/client/Scan.java index d553528b254..48d3e8b6601 100644 --- a/src/java/org/apache/hadoop/hbase/client/Scan.java +++ b/src/java/org/apache/hadoop/hbase/client/Scan.java @@ -595,26 +595,26 @@ public class Scan implements Writable { * @deprecated */ public String getInputColumns() { - String cols = ""; + StringBuilder cols = new StringBuilder(""); for (Map.Entry> e : familyMap.entrySet()) { byte[] fam = e.getKey(); - if (cols.length() > 0) cols += " "; + if (cols.length() > 0) cols.append(" "); NavigableSet quals = e.getValue(); // check if this family has qualifiers if (quals != null && quals.size() > 0) { - String cs = ""; + StringBuilder cs = new StringBuilder(""); for (byte[] qual : quals) { - if (cs.length() > 0) cs += " "; + if (cs.length() > 0) cs.append(" "); // encode values to make parsing easier later - cs += Bytes.toStringBinary(fam) + ":" + Bytes.toStringBinary(qual); + cs.append(Bytes.toStringBinary(fam) + ":" + Bytes.toStringBinary(qual)); } - cols += cs; + cols.append(cs); } else { // only add the family but with old style delimiter - cols += Bytes.toStringBinary(fam) + ":"; + cols.append(Bytes.toStringBinary(fam) + ":"); } } - return cols; + return cols.toString(); } } diff --git a/src/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java b/src/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java index 63f94afa068..af768cbefc2 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java @@ -130,7 +130,7 @@ public class KeyValueHeap implements KeyValueScanner, InternalScanner { return next(result, -1); } - private class KVScannerComparator implements Comparator { + private static class KVScannerComparator implements Comparator { private KVComparator kvComparator; /** * Constructor diff --git a/src/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java b/src/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java index 260a6f7ae17..8083045b833 100644 --- a/src/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java +++ b/src/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java @@ -3666,7 +3666,7 @@ public class Hbase { public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return new Boolean(isSuccess()); + return Boolean.valueOf(isSuccess()); case IO: return getIo(); diff --git a/src/test/org/apache/hadoop/hbase/regionserver/TestStoreReconstruction.java b/src/test/org/apache/hadoop/hbase/regionserver/TestStoreReconstruction.java index 4736e72609c..999926d83b5 100644 --- a/src/test/org/apache/hadoop/hbase/regionserver/TestStoreReconstruction.java +++ b/src/test/org/apache/hadoop/hbase/regionserver/TestStoreReconstruction.java @@ -40,8 +40,8 @@ public class TestStoreReconstruction { private Path dir; private MiniDFSCluster cluster; - private final String TABLE = "testtable"; - private final int TOTAL_EDITS = 10000; + private static final String TABLE = "testtable"; + private static final int TOTAL_EDITS = 10000; private HBaseConfiguration conf; /** diff --git a/src/test/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java b/src/test/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java index f1ec15b3b2d..ea1f93ef134 100644 --- a/src/test/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java +++ b/src/test/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java @@ -34,7 +34,7 @@ import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.util.Bytes; public class TestStoreScanner extends TestCase { - private final String CF_STR = "cf"; + private static final String CF_STR = "cf"; final byte [] CF = Bytes.toBytes(CF_STR); /** diff --git a/src/test/org/apache/hadoop/hbase/regionserver/TestWideScanner.java b/src/test/org/apache/hadoop/hbase/regionserver/TestWideScanner.java index c89b7bf978a..d2fddeddef1 100644 --- a/src/test/org/apache/hadoop/hbase/regionserver/TestWideScanner.java +++ b/src/test/org/apache/hadoop/hbase/regionserver/TestWideScanner.java @@ -21,7 +21,7 @@ import org.apache.hadoop.hdfs.MiniDFSCluster; public class TestWideScanner extends HBaseTestCase { private final Log LOG = LogFactory.getLog(this.getClass()); - final int BATCH = 1000; + static final int BATCH = 1000; private MiniDFSCluster cluster = null; private HRegion r; diff --git a/src/test/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java b/src/test/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java index 06a25aee79d..21f5ed7ad4c 100644 --- a/src/test/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java +++ b/src/test/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java @@ -193,7 +193,7 @@ public class TestHLog extends HBaseTestCase implements HConstants { public void testFindMemstoresWithEditsOlderThan() throws IOException { Map regionsToSeqids = new HashMap(); for (int i = 0; i < 10; i++) { - Long l = new Long(i); + Long l = Long.valueOf(i); regionsToSeqids.put(l.toString().getBytes(), l); } byte [][] regions =