HBASE-17212 Should add null checker on table name in HTable and RegionServerCallable constructor

This commit is contained in:
Yu Li 2016-12-01 02:25:31 +08:00
parent 8adf6857c7
commit f2e363b589
2 changed files with 6 additions and 0 deletions

View File

@ -163,6 +163,9 @@ public class HTable implements Table {
if (connection == null || connection.isClosed()) { if (connection == null || connection.isClosed()) {
throw new IllegalArgumentException("Connection is null or closed."); throw new IllegalArgumentException("Connection is null or closed.");
} }
if (tableName == null) {
throw new IllegalArgumentException("Given table name is null");
}
this.tableName = tableName; this.tableName = tableName;
this.cleanupConnectionOnClose = false; this.cleanupConnectionOnClose = false;
this.connection = connection; this.connection = connection;

View File

@ -78,6 +78,9 @@ public abstract class RegionServerCallable<T, S> implements RetryingCallable<T>
RpcController rpcController) { RpcController rpcController) {
super(); super();
this.connection = connection; this.connection = connection;
if (tableName == null) {
throw new IllegalArgumentException("Given tableName is null");
}
this.tableName = tableName; this.tableName = tableName;
this.row = row; this.row = row;
this.rpcController = rpcController; this.rpcController = rpcController;