Program: 172816
Project: 172816
Buggy source:
public int toColumnBinaryTree(final byte[] metaBinary,final int start,final byte[] dataBuffer,final boolean isNeedAllChild) throws IOException {
  ByteBuffer byteBuffer=ByteBuffer.wrap(metaBinary,start,(metaBinary.length - start));
  int offset=start;
  int childSize=byteBuffer.getInt(offset);
  offset+=PrimitiveByteLength.INT_LENGTH;
  for (int i=0; i < childSize; i++) {
    int childNameLength=byteBuffer.getInt(offset);
    offset+=PrimitiveByteLength.INT_LENGTH;
    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.UNKNOWN) {
        childColumnBinary.setColumnFilter(columnNameNode.getChild(childName));
        isAppend=true;
      }
 else {
        ColumnNameNode childColumnNameNode=new ColumnNameNode(childName);
        childColumnNameNode.setNeedAllChild(false);
        childColumnBinary.setColumnFilter(childColumnNameNode);
        isAppend=false;
      }
    }
    offset=childColumnBinary.toColumnBinaryTree(metaBinary,offset,dataBuffer);
    if (isAppend) {
      childCount=childColumnBinary.size();
      childTreeMap.put(childName,childColumnBinary);
    }
  }
  allBinaryStart=byteBuffer.getInt(offset);
  offset+=PrimitiveByteLength.INT_LENGTH;
  allBinaryLength=byteBuffer.getInt(offset);
  offset+=PrimitiveByteLength.INT_LENGTH;
  int currentMetaBinaryLength=byteBuffer.getInt(offset);
  offset+=PrimitiveByteLength.INT_LENGTH;
  if (currentMetaBinaryLength != 0) {
    for (int startOffset=offset; offset < startOffset + currentMetaBinaryLength; ) {
      currentCount++;
      int index=byteBuffer.getInt(offset);
      offset+=PrimitiveByteLength.INT_LENGTH;
      int metaBinaryLength=byteBuffer.getInt(offset);
      offset+=PrimitiveByteLength.INT_LENGTH;
      if (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);
          }
        }
        currentColumnBinaryList.add(ColumnBinary.newInstanceFromMetaBinary(metaBinary,offset,metaBinaryLength,dataBuffer,childList));
      }
      offset+=metaBinaryLength;
    }
  }
  return offset;
}

Fixed version (ground truth):
public int toColumnBinaryTree(final byte[] metaBinary,final int start,final byte[] dataBuffer,final boolean isNeedAllChild) throws IOException {
  ByteBuffer byteBuffer=ByteBuffer.wrap(metaBinary,start,(metaBinary.length - start));
  int offset=start;
  int childSize=byteBuffer.getInt(offset);
  offset+=PrimitiveByteLength.INT_LENGTH;
  for (int i=0; i < childSize; i++) {
    int childNameLength=byteBuffer.getInt(offset);
    offset+=PrimitiveByteLength.INT_LENGTH;
    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);
        childColumnNameNode.setNeedAllChild(false);
        childColumnBinary.setColumnFilter(childColumnNameNode);
        isAppend=false;
      }
    }
    offset=childColumnBinary.toColumnBinaryTree(metaBinary,offset,dataBuffer);
    if (isAppend) {
      childCount=childColumnBinary.size();
      childTreeMap.put(childName,childColumnBinary);
    }
  }
  allBinaryStart=byteBuffer.getInt(offset);
  offset+=PrimitiveByteLength.INT_LENGTH;
  allBinaryLength=byteBuffer.getInt(offset);
  offset+=PrimitiveByteLength.INT_LENGTH;
  int currentMetaBinaryLength=byteBuffer.getInt(offset);
  offset+=PrimitiveByteLength.INT_LENGTH;
  if (currentMetaBinaryLength != 0) {
    for (int startOffset=offset; offset < startOffset + currentMetaBinaryLength; ) {
      currentCount++;
      int index=byteBuffer.getInt(offset);
      offset+=PrimitiveByteLength.INT_LENGTH;
      int metaBinaryLength=byteBuffer.getInt(offset);
      offset+=PrimitiveByteLength.INT_LENGTH;
      if (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);
          }
        }
        currentColumnBinaryList.add(ColumnBinary.newInstanceFromMetaBinary(metaBinary,offset,metaBinaryLength,dataBuffer,childList));
      }
      offset+=metaBinaryLength;
    }
  }
  return offset;
}