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 547d97f5ca
commit edcac04ac1
2 changed files with 6 additions and 0 deletions

View File

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

View File

@ -60,6 +60,9 @@ public abstract class RegionServerCallable<T> implements RetryingCallable<T> {
*/
public RegionServerCallable(Connection connection, TableName tableName, byte [] row) {
this.connection = connection;
if (tableName == null) {
throw new IllegalArgumentException("Given tableName is null");
}
this.tableName = tableName;
this.row = row;
}