HBASE-2090 findbugs issues

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@895913 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-01-05 06:06:46 +00:00
parent 9cacb67b69
commit e2f7f90e00
8 changed files with 16 additions and 15 deletions

View File

@ -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

View File

@ -595,26 +595,26 @@ public class Scan implements Writable {
* @deprecated
*/
public String getInputColumns() {
String cols = "";
StringBuilder cols = new StringBuilder("");
for (Map.Entry<byte[], NavigableSet<byte[]>> e :
familyMap.entrySet()) {
byte[] fam = e.getKey();
if (cols.length() > 0) cols += " ";
if (cols.length() > 0) cols.append(" ");
NavigableSet<byte[]> 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();
}
}

View File

@ -130,7 +130,7 @@ public class KeyValueHeap implements KeyValueScanner, InternalScanner {
return next(result, -1);
}
private class KVScannerComparator implements Comparator<KeyValueScanner> {
private static class KVScannerComparator implements Comparator<KeyValueScanner> {
private KVComparator kvComparator;
/**
* Constructor

View File

@ -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();

View File

@ -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;
/**

View File

@ -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);
/**

View File

@ -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;

View File

@ -193,7 +193,7 @@ public class TestHLog extends HBaseTestCase implements HConstants {
public void testFindMemstoresWithEditsOlderThan() throws IOException {
Map<byte [], Long> regionsToSeqids = new HashMap<byte [], Long>();
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 =