HBASE-2908 Wrong order of null-check [in TIF]

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@984423 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-08-11 14:43:15 +00:00
parent e30ddb01aa
commit 8b5d7dbb1c
2 changed files with 4 additions and 3 deletions

View File

@ -474,6 +474,7 @@ Release 0.21.0 - Unreleased
HBASE-2897 RowResultGenerator should handle NoSuchColumnFamilyException
HBASE-2905 NPE when inserting mass data via REST interface (Sandy Yin via
Andrew Purtell)
HBASE-2908 Wrong order of null-check [in TIF] (Libor Dener via Stack)
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -123,14 +123,14 @@ extends InputFormat<ImmutableBytesWritable, Result> {
*/
@Override
public List<InputSplit> getSplits(JobContext context) throws IOException {
if (table == null) {
throw new IOException("No table was provided.");
}
Pair<byte[][], byte[][]> keys = table.getStartEndKeys();
if (keys == null || keys.getFirst() == null ||
keys.getFirst().length == 0) {
throw new IOException("Expecting at least one region.");
}
if (table == null) {
throw new IOException("No table was provided.");
}
int count = 0;
List<InputSplit> splits = new ArrayList<InputSplit>(keys.getFirst().length);
for (int i = 0; i < keys.getFirst().length; i++) {