Program: 172715
Project: 172715
Buggy source:
public int toColumnBinaryTree(final byte[] metaBinary,final int start,final boolean isNeedAllChild,final Set<Integer> spreadIndexDict) throws IOException {
  ByteBuffer byteBuffer=ByteBuffer.wrap(metaBinary,start,(metaBinary.length - start));
  int offset=start;
  int childSize=byteBuffer.getInt(offset);
  offset+=Integer.BYTES;
  for (int i=0; i < childSize; i++) {
    int childNameLength=byteBuffer.getInt(offset);
    offset+=Integer.BYTES;
    String childName=new String(metaBinary,offset,childNameLength);
    offset+=childNameLength;
    ColumnBinaryTree childColumnBinary=new ColumnBinaryTree();
    boolean isAppend=true;
    if (isNeedAllChild) {
      isAppend=true;
    }
 else {
      if (columnNameNode.containsChild(childName)) {
        childColumnBinary.setColumnFilter(columnNameNode.getChild(childName));
        isAppend=true;
      }
 else       if (ColumnTypeFactory.getColumnTypeFromName(childName) == ColumnType.ARRAY) {
        childColumnBinary.setColumnFilter(columnNameNode);
        isAppend=true;
      }
 else {
        ColumnNameNode childColumnNameNode=new ColumnNameNode(childName,true);
        childColumnNameNode.setNeedAllChild(false);
        childColumnBinary.setColumnFilter(childColumnNameNode);
        isAppend=false;
      }
    }
    offset=childColumnBinary.toColumnBinaryTree(metaBinary,offset,spreadIndexDict);
    if (isAppend) {
      childCount=childColumnBinary.size();
      childTreeMap.put(childName,childColumnBinary);
    }
  }
  allBinaryStart=byteBuffer.getInt(offset);
  offset+=Integer.BYTES;
  allBinaryLength=byteBuffer.getInt(offset);
  offset+=Integer.BYTES;
  int currentMetaBinaryLength=byteBuffer.getInt(offset);
  offset+=Integer.BYTES;
  if (currentMetaBinaryLength != 0) {
    byte[] childBuffer=null;
    int childStartDataOffset=0;
    if (!columnNameNode.isDisable()) {
      childBuffer=new byte[allBinaryLength];
    }
    for (int startOffset=offset; offset < startOffset + currentMetaBinaryLength; ) {
      int index=byteBuffer.getInt(offset);
      offset+=Integer.BYTES;
      int metaBinaryLength=byteBuffer.getInt(offset);
      offset+=Integer.BYTES;
      if (columnNameNode.isDisable() || metaBinaryLength == 0) {
        currentColumnBinaryList.add(null);
      }
 else {
        List<ColumnBinary> childList=new ArrayList<ColumnBinary>();
        for (        Map.Entry<String,ColumnBinaryTree> entry : childTreeMap.entrySet()) {
          ColumnBinary childColumnBinary=entry.getValue().getColumnBinary(index);
          if (childColumnBinary != null) {
            childList.add(childColumnBinary);
          }
        }
        ColumnBinary childColumnBinary=ColumnBinary.newInstanceFromMetaBinary(metaBinary,offset,metaBinaryLength,childBuffer,childList);
        if (spreadIndexDict == null || spreadIndexDict.contains(Integer.valueOf(currentCount))) {
          if (allBinaryLength != 0) {
            blockReadOffsetList.add(new BlockReadOffset(childColumnBinary.binaryStart,childStartDataOffset,childColumnBinary.binaryLength,childBuffer));
          }
          currentColumnBinaryList.add(childColumnBinary);
        }
 else {
          currentColumnBinaryList.add(null);
        }
        childColumnBinary.binaryStart=childStartDataOffset;
        childStartDataOffset+=childColumnBinary.binaryLength;
      }
      offset+=metaBinaryLength;
      currentCount++;
    }
    if (allBinaryLength != 0 && currentCount == blockReadOffsetList.size()) {
      blockReadOffsetList.clear();
      blockReadOffsetList.add(new BlockReadOffset(allBinaryStart,0,allBinaryLength,childBuffer));
    }
  }
  return offset;
}

Fixed version (ground truth):
public int toColumnBinaryTree(final byte[] metaBinary,final int start,final boolean isNeedAllChild,final Set<Integer> spreadIndexDict) throws IOException {
  ByteBuffer byteBuffer=ByteBuffer.wrap(metaBinary,start,(metaBinary.length - start));
  int offset=start;
  int childSize=byteBuffer.getInt(offset);
  offset+=Integer.BYTES;
  for (int i=0; i < childSize; i++) {
    int childNameLength=byteBuffer.getInt(offset);
    offset+=Integer.BYTES;
    String childName=new String(metaBinary,offset,childNameLength);
    offset+=childNameLength;
    ColumnBinaryTree childColumnBinary=new ColumnBinaryTree();
    boolean isAppend=true;
    if (isNeedAllChild) {
      isAppend=true;
    }
 else {
      if (columnNameNode.containsChild(childName)) {
        childColumnBinary.setColumnFilter(columnNameNode.getChild(childName));
        isAppend=true;
      }
 else       if (ColumnTypeFactory.getColumnTypeFromName(childName) == ColumnType.ARRAY) {
        childColumnBinary.setColumnFilter(columnNameNode);
        isAppend=true;
      }
 else {
        ColumnNameNode childColumnNameNode=new ColumnNameNode(childName,true);
        childColumnNameNode.setNeedAllChild(false);
        childColumnBinary.setColumnFilter(childColumnNameNode);
        isAppend=false;
      }
    }
    offset=childColumnBinary.toColumnBinaryTree(metaBinary,offset,spreadIndexDict);
    if (childCount < childColumnBinary.size()) {
      childCount=childColumnBinary.size();
    }
    if (isAppend) {
      childTreeMap.put(childName,childColumnBinary);
    }
  }
  allBinaryStart=byteBuffer.getInt(offset);
  offset+=Integer.BYTES;
  allBinaryLength=byteBuffer.getInt(offset);
  offset+=Integer.BYTES;
  int currentMetaBinaryLength=byteBuffer.getInt(offset);
  offset+=Integer.BYTES;
  if (currentMetaBinaryLength != 0) {
    byte[] childBuffer=null;
    int childStartDataOffset=0;
    if (!columnNameNode.isDisable()) {
      childBuffer=new byte[allBinaryLength];
    }
    for (int startOffset=offset; offset < startOffset + currentMetaBinaryLength; ) {
      int index=byteBuffer.getInt(offset);
      offset+=Integer.BYTES;
      int metaBinaryLength=byteBuffer.getInt(offset);
      offset+=Integer.BYTES;
      if (columnNameNode.isDisable() || metaBinaryLength == 0) {
        currentColumnBinaryList.add(null);
      }
 else {
        List<ColumnBinary> childList=new ArrayList<ColumnBinary>();
        for (        Map.Entry<String,ColumnBinaryTree> entry : childTreeMap.entrySet()) {
          ColumnBinary childColumnBinary=entry.getValue().getColumnBinary(index);
          if (childColumnBinary != null) {
            childList.add(childColumnBinary);
          }
        }
        ColumnBinary childColumnBinary=ColumnBinary.newInstanceFromMetaBinary(metaBinary,offset,metaBinaryLength,childBuffer,childList);
        if (spreadIndexDict == null || spreadIndexDict.contains(Integer.valueOf(currentCount))) {
          if (allBinaryLength != 0) {
            blockReadOffsetList.add(new BlockReadOffset(childColumnBinary.binaryStart,childStartDataOffset,childColumnBinary.binaryLength,childBuffer));
          }
          currentColumnBinaryList.add(childColumnBinary);
        }
 else {
          currentColumnBinaryList.add(null);
        }
        childColumnBinary.binaryStart=childStartDataOffset;
        childStartDataOffset+=childColumnBinary.binaryLength;
      }
      offset+=metaBinaryLength;
      currentCount++;
    }
    if (allBinaryLength != 0 && currentCount == blockReadOffsetList.size()) {
      blockReadOffsetList.clear();
      blockReadOffsetList.add(new BlockReadOffset(allBinaryStart,0,allBinaryLength,childBuffer));
    }
  }
  return offset;
}