rantav/hector — Issue #427: hasNext() in HColumnFamilyImpl should work when there's only one key
Author: sleepingpig
Created: 2012-02-24 18:15:59+00:00
State: open

If there's only key added to the HColumnFamilyImpl, and we call hasNext() of it, then NullPointerException will be thrown.
For example, the following code will work,

int nKey=2;
HColumnFamily cf=...
for(int i=0;i1, calling cf.hasNext() before calling getXXX() will get NullPointerException.

By the way, the implementation of HColumnFamilyImpl has cursor at 0 initially.
Would it be better to have the cursor initially at -1, so that we can use it like below?
while(cf.hasNext())
{
cf.next();
// do something
}
It may make it more like an ordinary Iterator.