Program: 61113
Project: 61113
Buggy source:
/** 
 * Determines if the caller should do one of several things: - seek/skip to the next row (MatchCode.SEEK_NEXT_ROW) - seek/skip to the next column (MatchCode.SEEK_NEXT_COL) - include the current KeyValue (MatchCode.INCLUDE) - ignore the current KeyValue (MatchCode.SKIP) - got to the next row (MatchCode.DONE)
 * @param cell KeyValue to check
 * @return The match code instance.
 * @throws IOException in case there is an internal consistency problemcaused by a data corruption.
 */
public MatchCode match(Cell cell) throws IOException {
  if (filter != null && filter.filterAllRemaining()) {
    return MatchCode.DONE_SCAN;
  }
  if (curCell != null) {
    int ret=this.rowComparator.compareRows(curCell,cell);
    if (!this.isReversed) {
      if (ret <= -1) {
        return MatchCode.DONE;
      }
 else       if (ret >= 1) {
        return MatchCode.SEEK_NEXT_ROW;
      }
    }
 else {
      if (ret <= -1) {
        return MatchCode.SEEK_NEXT_ROW;
      }
 else       if (ret >= 1) {
        return MatchCode.DONE;
      }
    }
  }
 else {
    return MatchCode.DONE;
  }
  if (this.stickyNextRow) {
    return MatchCode.SEEK_NEXT_ROW;
  }
  if (this.columns.done()) {
    stickyNextRow=true;
    return MatchCode.SEEK_NEXT_ROW;
  }
  long timestamp=cell.getTimestamp();
  if (columns.isDone(timestamp)) {
    return columns.getNextRowOrNextColumn(cell);
  }
  if (HStore.isCellTTLExpired(cell,this.oldestUnexpiredTS,this.now)) {
    return MatchCode.SKIP;
  }
  byte typeByte=cell.getTypeByte();
  long mvccVersion=cell.getSequenceId();
  if (CellUtil.isDelete(cell)) {
    if (keepDeletedCells == KeepDeletedCells.FALSE || (keepDeletedCells == KeepDeletedCells.TTL && timestamp < ttl)) {
      boolean includeDeleteMarker=seePastDeleteMarkers ? tr.withinTimeRange(timestamp) : tr.withinOrAfterTimeRange(timestamp);
      if (includeDeleteMarker && mvccVersion <= maxReadPointToTrackVersions) {
        this.deletes.add(cell);
      }
    }
    if ((!isUserScan) && timeToPurgeDeletes > 0 && (EnvironmentEdgeManager.currentTime() - timestamp) <= timeToPurgeDeletes) {
      return MatchCode.INCLUDE;
    }
 else     if (retainDeletesInOutput || mvccVersion > maxReadPointToTrackVersions) {
      if (!isUserScan) {
        return MatchCode.INCLUDE;
      }
    }
 else     if (keepDeletedCells == KeepDeletedCells.TRUE || (keepDeletedCells == KeepDeletedCells.TTL && timestamp >= ttl)) {
      if (timestamp < earliestPutTs) {
        return columns.getNextRowOrNextColumn(cell);
      }
    }
 else {
      return MatchCode.SKIP;
    }
  }
 else   if (!this.deletes.isEmpty()) {
    DeleteResult deleteResult=deletes.isDeleted(cell);
switch (deleteResult) {
case FAMILY_DELETED:
case COLUMN_DELETED:
      return columns.getNextRowOrNextColumn(cell);
case VERSION_DELETED:
case FAMILY_VERSION_DELETED:
    return MatchCode.SKIP;
case NOT_DELETED:
  break;
default :
throw new RuntimeException("String_Node_Str");
}
}
int timestampComparison=tr.compare(timestamp);
if (timestampComparison >= 1) {
return MatchCode.SKIP;
}
 else if (timestampComparison <= -1) {
return columns.getNextRowOrNextColumn(cell);
}
MatchCode colChecker=columns.checkColumn(cell,typeByte);
if (colChecker == MatchCode.INCLUDE) {
ReturnCode filterResponse=ReturnCode.SKIP;
if (filter != null) {
filterResponse=filter.filterKeyValue(cell);
switch (filterResponse) {
case SKIP:
return MatchCode.SKIP;
case NEXT_COL:
return columns.getNextRowOrNextColumn(cell);
case NEXT_ROW:
stickyNextRow=true;
return MatchCode.SEEK_NEXT_ROW;
case SEEK_NEXT_USING_HINT:
return MatchCode.SEEK_NEXT_USING_HINT;
default :
break;
}
}
colChecker=columns.checkVersions(cell,timestamp,typeByte,mvccVersion > maxReadPointToTrackVersions);
boolean seekNextRowFromEssential=filterResponse == ReturnCode.INCLUDE_AND_SEEK_NEXT_ROW && filter.isFamilyEssential(cell.getFamilyArray());
if (colChecker == MatchCode.INCLUDE_AND_SEEK_NEXT_ROW || seekNextRowFromEssential) {
stickyNextRow=true;
}
if (filterResponse == ReturnCode.INCLUDE_AND_SEEK_NEXT_ROW) {
if (colChecker != MatchCode.SKIP) {
return MatchCode.INCLUDE_AND_SEEK_NEXT_ROW;
}
return MatchCode.SEEK_NEXT_ROW;
}
return (filterResponse == ReturnCode.INCLUDE_AND_NEXT_COL && colChecker == MatchCode.INCLUDE) ? MatchCode.INCLUDE_AND_SEEK_NEXT_COL : colChecker;
}
stickyNextRow=(colChecker == MatchCode.SEEK_NEXT_ROW) ? true : stickyNextRow;
return colChecker;
}

Fixed version (ground truth):
/** 
 * Determines if the caller should do one of several things: - seek/skip to the next row (MatchCode.SEEK_NEXT_ROW) - seek/skip to the next column (MatchCode.SEEK_NEXT_COL) - include the current KeyValue (MatchCode.INCLUDE) - ignore the current KeyValue (MatchCode.SKIP) - got to the next row (MatchCode.DONE)
 * @param cell KeyValue to check
 * @return The match code instance.
 * @throws IOException in case there is an internal consistency problemcaused by a data corruption.
 */
public MatchCode match(Cell cell) throws IOException {
  if (filter != null && filter.filterAllRemaining()) {
    return MatchCode.DONE_SCAN;
  }
  if (curCell != null) {
    int ret=this.rowComparator.compareRows(curCell,cell);
    if (!this.isReversed) {
      if (ret <= -1) {
        return MatchCode.DONE;
      }
 else       if (ret >= 1) {
        return MatchCode.SEEK_NEXT_ROW;
      }
    }
 else {
      if (ret <= -1) {
        return MatchCode.SEEK_NEXT_ROW;
      }
 else       if (ret >= 1) {
        return MatchCode.DONE;
      }
    }
  }
 else {
    return MatchCode.DONE;
  }
  if (this.stickyNextRow) {
    return MatchCode.SEEK_NEXT_ROW;
  }
  if (this.columns.done()) {
    stickyNextRow=true;
    return MatchCode.SEEK_NEXT_ROW;
  }
  long timestamp=cell.getTimestamp();
  if (columns.isDone(timestamp)) {
    return columns.getNextRowOrNextColumn(cell);
  }
  if (HStore.isCellTTLExpired(cell,this.oldestUnexpiredTS,this.now)) {
    return MatchCode.SKIP;
  }
  byte typeByte=cell.getTypeByte();
  long mvccVersion=cell.getSequenceId();
  if (CellUtil.isDelete(cell)) {
    if (keepDeletedCells == KeepDeletedCells.FALSE || (keepDeletedCells == KeepDeletedCells.TTL && timestamp < ttl)) {
      boolean includeDeleteMarker=seePastDeleteMarkers ? tr.withinTimeRange(timestamp) : tr.withinOrAfterTimeRange(timestamp);
      if (includeDeleteMarker && mvccVersion <= maxReadPointToTrackVersions) {
        this.deletes.add(cell);
      }
    }
    if ((!isUserScan) && timeToPurgeDeletes > 0 && (EnvironmentEdgeManager.currentTime() - timestamp) <= timeToPurgeDeletes) {
      return MatchCode.INCLUDE;
    }
 else     if (retainDeletesInOutput || mvccVersion > maxReadPointToTrackVersions) {
      if (!isUserScan) {
        return MatchCode.INCLUDE;
      }
    }
 else     if (keepDeletedCells == KeepDeletedCells.TRUE || (keepDeletedCells == KeepDeletedCells.TTL && timestamp >= ttl)) {
      if (timestamp < earliestPutTs) {
        return columns.getNextRowOrNextColumn(cell);
      }
    }
 else {
      return MatchCode.SKIP;
    }
  }
 else   if (!this.deletes.isEmpty()) {
    DeleteResult deleteResult=deletes.isDeleted(cell);
switch (deleteResult) {
case FAMILY_DELETED:
case COLUMN_DELETED:
      return columns.getNextRowOrNextColumn(cell);
case VERSION_DELETED:
case FAMILY_VERSION_DELETED:
    return MatchCode.SKIP;
case NOT_DELETED:
  break;
default :
throw new RuntimeException("String_Node_Str");
}
}
int timestampComparison=timestamp == HConstants.OLDEST_TIMESTAMP ? -1 : tr.compare(timestamp);
if (timestampComparison >= 1) {
return MatchCode.SKIP;
}
 else if (timestampComparison <= -1) {
return columns.getNextRowOrNextColumn(cell);
}
MatchCode colChecker=columns.checkColumn(cell,typeByte);
if (colChecker == MatchCode.INCLUDE) {
ReturnCode filterResponse=ReturnCode.SKIP;
if (filter != null) {
filterResponse=filter.filterKeyValue(cell);
switch (filterResponse) {
case SKIP:
return MatchCode.SKIP;
case NEXT_COL:
return columns.getNextRowOrNextColumn(cell);
case NEXT_ROW:
stickyNextRow=true;
return MatchCode.SEEK_NEXT_ROW;
case SEEK_NEXT_USING_HINT:
return MatchCode.SEEK_NEXT_USING_HINT;
default :
break;
}
}
colChecker=columns.checkVersions(cell,timestamp,typeByte,mvccVersion > maxReadPointToTrackVersions);
boolean seekNextRowFromEssential=filterResponse == ReturnCode.INCLUDE_AND_SEEK_NEXT_ROW && filter.isFamilyEssential(cell.getFamilyArray());
if (colChecker == MatchCode.INCLUDE_AND_SEEK_NEXT_ROW || seekNextRowFromEssential) {
stickyNextRow=true;
}
if (filterResponse == ReturnCode.INCLUDE_AND_SEEK_NEXT_ROW) {
if (colChecker != MatchCode.SKIP) {
return MatchCode.INCLUDE_AND_SEEK_NEXT_ROW;
}
return MatchCode.SEEK_NEXT_ROW;
}
return (filterResponse == ReturnCode.INCLUDE_AND_NEXT_COL && colChecker == MatchCode.INCLUDE) ? MatchCode.INCLUDE_AND_SEEK_NEXT_COL : colChecker;
}
stickyNextRow=(colChecker == MatchCode.SEEK_NEXT_ROW) ? true : stickyNextRow;
return colChecker;
}