HBASE-5645 [findbugs] Fix correctness warnings (David S Wang and Uma Maheswara Rao G)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1324969 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a2ff41653a
commit
8575edd908
|
@ -38,4 +38,3 @@ cat jenkins.out | while read line; do
|
|||
prevLine=$line
|
||||
fi
|
||||
done
|
||||
rm jenkins.out
|
||||
|
|
|
@ -19,5 +19,5 @@ MAVEN_OPTS="-Xmx3g"
|
|||
# Please update the per-module test-patch.properties if you update this file.
|
||||
|
||||
OK_RELEASEAUDIT_WARNINGS=84
|
||||
OK_FINDBUGS_WARNINGS=561
|
||||
OK_FINDBUGS_WARNINGS=549
|
||||
OK_JAVADOC_WARNINGS=169
|
||||
|
|
|
@ -558,9 +558,7 @@ public class HFile {
|
|||
hfs = (HFileSystem)fs;
|
||||
// open a stream to read data without checksum verification in
|
||||
// the filesystem
|
||||
if (hfs != null) {
|
||||
fsdisNoFsChecksum = hfs.getNoChecksumFs().open(path);
|
||||
}
|
||||
fsdisNoFsChecksum = hfs.getNoChecksumFs().open(path);
|
||||
}
|
||||
return pickReaderVersion(path, fsdis, fsdisNoFsChecksum,
|
||||
fs.getFileStatus(path).getLen(), closeIStream, cacheConf,
|
||||
|
|
|
@ -127,8 +127,8 @@ public class CellCounter {
|
|||
new IntWritable(1));
|
||||
context.write(new Text(thisRowFamilyName), new IntWritable(1));
|
||||
}
|
||||
String thisRowQualifierName =
|
||||
thisRowFamilyName + separator + Bytes.toStringBinary(value.getQualifier());
|
||||
String thisRowQualifierName = thisRowFamilyName + separator
|
||||
+ Bytes.toStringBinary(value.getQualifier());
|
||||
if (thisRowQualifierName != null &&
|
||||
!thisRowQualifierName.equals(currentQualifierName)) {
|
||||
currentQualifierName = thisRowQualifierName;
|
||||
|
@ -139,16 +139,16 @@ public class CellCounter {
|
|||
// Intialize versions
|
||||
context.getCounter("QL_VERSIONS", currentRowKey + separator +
|
||||
thisRowQualifierName).increment(1);
|
||||
context.write(new Text(currentRowKey + separator + thisRowQualifierName +
|
||||
"_Versions"), new IntWritable(1));
|
||||
context.write(new Text(currentRowKey + separator
|
||||
+ thisRowQualifierName + "_Versions"), new IntWritable(1));
|
||||
|
||||
} else {
|
||||
// Increment versions
|
||||
currentQualifierName = thisRowQualifierName;
|
||||
context.getCounter("QL_VERSIONS", currentRowKey + separator +
|
||||
thisRowQualifierName).increment(1);
|
||||
context.write(new Text(currentRowKey + separator + thisRowQualifierName + "_Versions"),
|
||||
new IntWritable(1));
|
||||
context.write(new Text(currentRowKey + separator
|
||||
+ thisRowQualifierName + "_Versions"), new IntWritable(1));
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
|
|
|
@ -927,7 +927,7 @@ public class AssignmentManager extends ZooKeeperListener {
|
|||
return p.getFirst();
|
||||
} catch (IOException e) {
|
||||
master.abort("Aborting because error occoured while reading "
|
||||
+ data.getRegionName() + " from .META.", e);
|
||||
+ Bytes.toStringBinary(data.getRegionName()) + " from .META.", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -1756,7 +1756,6 @@ public class AssignmentManager extends ZooKeeperListener {
|
|||
boolean asyncSetOfflineInZooKeeper(final RegionState state,
|
||||
final AsyncCallback.StringCallback cb, final Object ctx) {
|
||||
if (!state.isClosed() && !state.isOffline()) {
|
||||
new RuntimeException("Unexpected state trying to OFFLINE; " + state);
|
||||
this.master.abort("Unexpected state trying to OFFLINE; " + state,
|
||||
new IllegalStateException());
|
||||
return false;
|
||||
|
|
|
@ -691,8 +691,8 @@ public class DefaultLoadBalancer implements LoadBalancer {
|
|||
get(Bytes.toString(tableName));
|
||||
}
|
||||
} catch (FileNotFoundException fnfe) {
|
||||
LOG.debug("FileNotFoundException during getTableDescriptors." +
|
||||
" Current table name = " + tableName , fnfe);
|
||||
LOG.debug("FileNotFoundException during getTableDescriptors."
|
||||
+ " Current table name = " + Bytes.toStringBinary(tableName), fnfe);
|
||||
}
|
||||
|
||||
return tableDescriptor;
|
||||
|
|
|
@ -256,7 +256,7 @@ Server {
|
|||
// Creation of a HSA will force a resolve.
|
||||
InetSocketAddress initialIsa = new InetSocketAddress(hostname, port);
|
||||
if (initialIsa.getAddress() == null) {
|
||||
throw new IllegalArgumentException("Failed resolve of " + this.isa);
|
||||
throw new IllegalArgumentException("Failed resolve of " + initialIsa);
|
||||
}
|
||||
int numHandlers = conf.getInt("hbase.master.handler.count",
|
||||
conf.getInt("hbase.regionserver.handler.count", 25));
|
||||
|
|
|
@ -533,7 +533,7 @@ public class ServerManager {
|
|||
*/
|
||||
private HRegionInterface getServerConnection(final ServerName sn)
|
||||
throws IOException {
|
||||
HRegionInterface hri = this.serverConnections.get(sn.toString());
|
||||
HRegionInterface hri = this.serverConnections.get(sn);
|
||||
if (hri == null) {
|
||||
LOG.debug("New connection to " + sn.toString());
|
||||
hri = this.connection.getHRegionConnection(sn.getHostname(), sn.getPort());
|
||||
|
|
|
@ -259,9 +259,8 @@ public class MemStoreLAB {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Allocation(data=" + data +
|
||||
" with capacity=" + data.length +
|
||||
", off=" + offset + ")";
|
||||
return "Allocation(" + "capacity=" + data.length + ", off=" + offset
|
||||
+ ")";
|
||||
}
|
||||
|
||||
byte[] getData() {
|
||||
|
|
|
@ -963,7 +963,7 @@ public class StoreFile extends SchemaConfigured {
|
|||
.withPath(fs, path)
|
||||
.withBlockSize(blocksize)
|
||||
.withCompression(compress)
|
||||
.withDataBlockEncoder(dataBlockEncoder)
|
||||
.withDataBlockEncoder(this.dataBlockEncoder)
|
||||
.withComparator(comparator.getRawComparator())
|
||||
.withChecksumType(checksumType)
|
||||
.withBytesPerChecksum(bytesPerChecksum)
|
||||
|
|
|
@ -791,11 +791,6 @@ public class ReplicationSource extends Thread
|
|||
return Long.valueOf(getTS(o1)).compareTo(getTS(o2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Split a path to get the start time
|
||||
* For example: 10.20.20.171%3A60020.1277499063250
|
||||
|
|
|
@ -273,7 +273,7 @@ public class FSTableDescriptors implements TableDescriptors {
|
|||
Path p = status[i].getPath();
|
||||
// Clean up old versions
|
||||
if (!fs.delete(p, false)) {
|
||||
LOG.warn("Failed cleanup of " + status);
|
||||
LOG.warn("Failed cleanup of " + p);
|
||||
} else {
|
||||
LOG.debug("Cleaned up old tableinfo file " + p);
|
||||
}
|
||||
|
|
|
@ -832,7 +832,7 @@ public abstract class FSUtils {
|
|||
public boolean accept(Path p) {
|
||||
boolean isValid = false;
|
||||
try {
|
||||
if (HConstants.HBASE_NON_USER_TABLE_DIRS.contains(p)) {
|
||||
if (HConstants.HBASE_NON_USER_TABLE_DIRS.contains(p.toString())) {
|
||||
isValid = false;
|
||||
} else {
|
||||
isValid = this.fs.getFileStatus(p).isDir();
|
||||
|
|
|
@ -231,9 +231,8 @@ public class JVMClusterUtil {
|
|||
}
|
||||
}
|
||||
}
|
||||
// regionServerThreads can never be null because they are initialized when
|
||||
// the class is constructed.
|
||||
for(RegionServerThread t: regionservers) {
|
||||
if (regionservers != null) {
|
||||
for (RegionServerThread t : regionservers) {
|
||||
if (t.isAlive()) {
|
||||
try {
|
||||
t.getRegionServer().stop("Shutdown requested");
|
||||
|
@ -243,6 +242,7 @@ public class JVMClusterUtil {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (masters != null) {
|
||||
for (JVMClusterUtil.MasterThread t : masters) {
|
||||
while (t.master.isAlive()) {
|
||||
|
|
|
@ -192,8 +192,8 @@ public class PoolMap<K, V> implements Map<K, V> {
|
|||
for (Map.Entry<K, Pool<V>> poolEntry : pools.entrySet()) {
|
||||
final K poolKey = poolEntry.getKey();
|
||||
final Pool<V> pool = poolEntry.getValue();
|
||||
for (final V poolValue : pool.values()) {
|
||||
if (pool != null) {
|
||||
if (pool != null) {
|
||||
for (final V poolValue : pool.values()) {
|
||||
entries.add(new Map.Entry<K, V>() {
|
||||
@Override
|
||||
public K getKey() {
|
||||
|
|
Loading…
Reference in New Issue