Program: 60898
Project: 60898
Buggy source:
@Override public HFileScanner getScanner(final boolean cacheBlocks,final boolean pread,final boolean isCompaction){
  final HFileScanner s=super.getScanner(cacheBlocks,pread,isCompaction);
  return new HFileScanner(){
    final HFileScanner delegate=s;
    public boolean atEnd=false;
    public Cell getKey(){
      if (atEnd)       return null;
      return delegate.getKey();
    }
    public String getKeyString(){
      if (atEnd)       return null;
      return delegate.getKeyString();
    }
    public ByteBuffer getValue(){
      if (atEnd)       return null;
      return delegate.getValue();
    }
    public String getValueString(){
      if (atEnd)       return null;
      return delegate.getValueString();
    }
    public Cell getCell(){
      if (atEnd)       return null;
      return delegate.getCell();
    }
    public boolean next() throws IOException {
      if (atEnd)       return false;
      boolean b=delegate.next();
      if (!b) {
        return b;
      }
      if (!top) {
        if (getComparator().compare(splitCell,getKey()) <= 0) {
          atEnd=true;
          return false;
        }
      }
      return true;
    }
    @Override public boolean seekTo() throws IOException {
      if (top) {
        int r=this.delegate.seekTo(splitCell);
        if (r == HConstants.INDEX_KEY_MAGIC) {
          return true;
        }
        if (r < 0) {
          return this.delegate.seekTo();
        }
        if (r > 0) {
          return this.delegate.next();
        }
        return true;
      }
      boolean b=delegate.seekTo();
      if (!b) {
        return b;
      }
      return (this.delegate.getReader().getComparator().compare(splitCell,getKey())) > 0;
    }
    public org.apache.hadoop.hbase.io.hfile.HFile.Reader getReader(){
      return this.delegate.getReader();
    }
    public boolean isSeeked(){
      return this.delegate.isSeeked();
    }
    @Override public int seekTo(    Cell key) throws IOException {
      if (top) {
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,splitCell) < 0) {
          return -1;
        }
      }
 else {
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,splitCell) >= 0) {
          boolean res=delegate.seekBefore(splitCell);
          if (!res) {
            throw new IOException("String_Node_Str" + "String_Node_Str");
          }
          return 1;
        }
      }
      return delegate.seekTo(key);
    }
    @Override public int reseekTo(    Cell key) throws IOException {
      if (top) {
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,splitCell) < 0) {
          return -1;
        }
      }
 else {
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,splitCell) >= 0) {
          boolean res=delegate.seekBefore(splitCell);
          if (!res) {
            throw new IOException("String_Node_Str" + "String_Node_Str");
          }
          return 1;
        }
      }
      if (atEnd) {
        return 1;
      }
      return delegate.reseekTo(key);
    }
    @Override public boolean seekBefore(    Cell key) throws IOException {
      if (top) {
        Optional<Cell> fk=getFirstKey();
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,fk.get()) <= 0) {
          return false;
        }
      }
 else {
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,splitCell) >= 0) {
          boolean ret=this.delegate.seekBefore(splitCell);
          if (ret) {
            atEnd=false;
          }
          return ret;
        }
      }
      boolean ret=this.delegate.seekBefore(key);
      if (ret) {
        atEnd=false;
      }
      return ret;
    }
    @Override public Cell getNextIndexedKey(){
      return null;
    }
    @Override public void close(){
      this.delegate.close();
    }
    @Override public void shipped() throws IOException {
      this.delegate.shipped();
    }
  }
;
}

Fixed version (ground truth):
@Override public HFileScanner getScanner(final boolean cacheBlocks,final boolean pread,final boolean isCompaction){
  final HFileScanner s=super.getScanner(cacheBlocks,pread,isCompaction);
  return new HFileScanner(){
    final HFileScanner delegate=s;
    public boolean atEnd=false;
    @Override public Cell getKey(){
      if (atEnd)       return null;
      return delegate.getKey();
    }
    @Override public String getKeyString(){
      if (atEnd)       return null;
      return delegate.getKeyString();
    }
    @Override public ByteBuffer getValue(){
      if (atEnd)       return null;
      return delegate.getValue();
    }
    @Override public String getValueString(){
      if (atEnd)       return null;
      return delegate.getValueString();
    }
    @Override public Cell getCell(){
      if (atEnd)       return null;
      return delegate.getCell();
    }
    @Override public boolean next() throws IOException {
      if (atEnd)       return false;
      boolean b=delegate.next();
      if (!b) {
        return b;
      }
      if (!top) {
        if (getComparator().compare(splitCell,getKey()) <= 0) {
          atEnd=true;
          return false;
        }
      }
      return true;
    }
    @Override public boolean seekTo() throws IOException {
      if (top) {
        int r=this.delegate.seekTo(splitCell);
        if (r == HConstants.INDEX_KEY_MAGIC) {
          return true;
        }
        if (r < 0) {
          return this.delegate.seekTo();
        }
        if (r > 0) {
          return this.delegate.next();
        }
        return true;
      }
      boolean b=delegate.seekTo();
      if (!b) {
        return b;
      }
      return (this.delegate.getReader().getComparator().compare(splitCell,getKey())) > 0;
    }
    @Override public org.apache.hadoop.hbase.io.hfile.HFile.Reader getReader(){
      return this.delegate.getReader();
    }
    @Override public boolean isSeeked(){
      return this.delegate.isSeeked();
    }
    @Override public int seekTo(    Cell key) throws IOException {
      if (top) {
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,splitCell) < 0) {
          return -1;
        }
      }
 else {
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,splitCell) >= 0) {
          boolean res=delegate.seekBefore(splitCell);
          if (!res) {
            throw new IOException("String_Node_Str" + "String_Node_Str");
          }
          return 1;
        }
      }
      return delegate.seekTo(key);
    }
    @Override public int reseekTo(    Cell key) throws IOException {
      if (top) {
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,splitCell) < 0) {
          return -1;
        }
      }
 else {
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,splitCell) >= 0) {
          boolean res=delegate.seekBefore(splitCell);
          if (!res) {
            throw new IOException("String_Node_Str" + "String_Node_Str");
          }
          return 1;
        }
      }
      if (atEnd) {
        return 1;
      }
      return delegate.reseekTo(key);
    }
    @Override public boolean seekBefore(    Cell key) throws IOException {
      if (top) {
        Optional<Cell> fk=getFirstKey();
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,fk.get()) <= 0) {
          return false;
        }
      }
 else {
        if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(),key,splitCell) >= 0) {
          boolean ret=this.delegate.seekBefore(splitCell);
          if (ret) {
            atEnd=false;
          }
          return ret;
        }
      }
      boolean ret=this.delegate.seekBefore(key);
      if (ret) {
        atEnd=false;
      }
      return ret;
    }
    @Override public Cell getNextIndexedKey(){
      return null;
    }
    @Override public void close(){
      this.delegate.close();
    }
    @Override public void shipped() throws IOException {
      this.delegate.shipped();
    }
  }
;
}