HADOOP-1941 StopRowFilter throws NPE when passed null row

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk/src/contrib/hbase@579410 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2007-09-25 23:04:08 +00:00
parent 87f305b608
commit ccf42acf70
3 changed files with 9 additions and 0 deletions

View File

@ -61,6 +61,7 @@ Trunk (unreleased changes)
HADOOP-1923, HADOOP-1924 a) tests fail sporadically because set up and tear
down is inconsistent b) TestDFSAbort failed in nightly #242
HADOOP-1929 Add hbase-default.xml to hbase jar
HADOOP-1941 StopRowFilter throws NPE when passed null row
IMPROVEMENTS
HADOOP-1737 Make HColumnDescriptor data publically members settable

View File

@ -98,6 +98,12 @@ public class StopRowFilter implements RowFilterInterface {
/** {@inheritDoc} */
public boolean filter(final Text rowKey) {
if (rowKey == null) {
if (this.stopRowKey == null) {
return true;
}
return false;
}
boolean result = this.stopRowKey.compareTo(rowKey) <= 0;
if (LOG.isDebugEnabled()) {
LOG.debug("Filter result for rowKey: " + rowKey + ". Result: " +

View File

@ -87,5 +87,7 @@ public class TestStopRowFilter extends TestCase {
assertFalse("FilterAllRemaining", filter.filterAllRemaining());
assertFalse("FilterNotNull", filter.filterNotNull(null));
assertFalse("Filter a null", filter.filter(null));
}
}