Program: 79125
Project: 79125
Buggy source:
/** 
 * Deserialze result object array from input stream. Datatype Corresponds to executor#setDataType One point needs to be noticed that the read and write procedure is strictly be conversed. 
 * @param br input stream
 * @param length how many objects needs to be read
 * @return result object array
 * @throws IOException
 */
IResultObject[] readData(BufferedInputStream bis,int length) throws IOException {
  ResultObject[] rowDatas=new ResultObject[length];
  byte[] intBytes=new byte[FixedBytesLengOfInt];
  int rowDataLen;
  byte[] rowDataBytes;
  ByteArrayInputStream bais;
  ObjectInputStream ois;
  for (int i=0; i < length; i++) {
    bis.read(intBytes);
    rowDataLen=getIntOfBytes(intBytes);
    rowDataBytes=new byte[rowDataLen];
    bis.read(rowDataBytes);
    bais=new ByteArrayInputStream(rowDataBytes);
    ois=new ObjectInputStream(bais);
    Object[] obs=new Object[columnCount];
    for (int j=0; j < columnCount; j++) {
      Class fieldType=typeArray[j];
      if (isNullObject(readIndex,j))       obs[j]=null;
 else       if (fieldType.equals(Integer.class))       obs[j]=new Integer(ois.readInt());
 else       if (fieldType.equals(Double.class))       obs[j]=new Double(ois.readDouble());
 else       if (fieldType.equals(BigDecimal.class))       obs[j]=new BigDecimal(ois.readUTF());
 else       if (fieldType.equals(Date.class))       obs[j]=new Date(ois.readLong());
 else       if (fieldType.equals(Time.class))       obs[j]=new Time(ois.readLong());
 else       if (fieldType.equals(Timestamp.class))       obs[j]=new Timestamp(ois.readLong());
 else       if (fieldType.equals(Boolean.class))       obs[j]=new Boolean(ois.readBoolean());
 else       if (fieldType.equals(String.class) || fieldType.equals(DataType.getClass(DataType.ANY_TYPE)))       obs[j]=ois.readUTF();
    }
    rowDatas[i]=newResultObject(obs);
    rowDataBytes=null;
    bais=null;
    ois=null;
    readIndex++;
  }
  return rowDatas;
}

Fixed version (ground truth):
/** 
 * Deserialze result object array from input stream. The reading procedure is strictly sequential, that means there is no random access. Datatype Corresponds to executor#setDataType
 * @param br input stream
 * @param length how many objects needs to be read
 * @param posHint hint info of current read position, this value does not affect the sequence reading
 * @return result object array
 * @throws IOException
 */
IResultObject[] readData(BufferedInputStream bis,int length,int posHint) throws IOException {
  ResultObject[] rowDatas=new ResultObject[length];
  byte[] intBytes=new byte[FixedBytesLengOfInt];
  int rowDataLen;
  byte[] rowDataBytes;
  ByteArrayInputStream bais;
  ObjectInputStream ois;
  for (int i=0; i < length; i++) {
    bis.read(intBytes);
    rowDataLen=getIntOfBytes(intBytes);
    rowDataBytes=new byte[rowDataLen];
    bis.read(rowDataBytes);
    bais=new ByteArrayInputStream(rowDataBytes);
    ois=new ObjectInputStream(bais);
    Object[] obs=new Object[columnCount];
    for (int j=0; j < columnCount; j++) {
      Class fieldType=typeArray[j];
      if (isNullObject(posHint + i,j))       obs[j]=null;
 else       if (fieldType.equals(Integer.class))       obs[j]=new Integer(ois.readInt());
 else       if (fieldType.equals(Double.class))       obs[j]=new Double(ois.readDouble());
 else       if (fieldType.equals(BigDecimal.class))       obs[j]=new BigDecimal(ois.readUTF());
 else       if (fieldType.equals(Date.class))       obs[j]=new Date(ois.readLong());
 else       if (fieldType.equals(Time.class))       obs[j]=new Time(ois.readLong());
 else       if (fieldType.equals(Timestamp.class))       obs[j]=new Timestamp(ois.readLong());
 else       if (fieldType.equals(Boolean.class))       obs[j]=new Boolean(ois.readBoolean());
 else       if (fieldType.equals(String.class) || fieldType.equals(DataType.getClass(DataType.ANY_TYPE)))       obs[j]=ois.readUTF();
    }
    rowDatas[i]=newResultObject(obs);
    rowDataBytes=null;
    bais=null;
    ois=null;
  }
  return rowDatas;
}