Program: 2574
Project: 2574
Buggy source:
/** 
 * Default constructor
 * @param classMetaData The class meta data
 * @param mappingUtils The mapping utils to use for byte mapping
 */
public EntityFacade(ClassMetaData classMetaData,MappingUtils mappingUtils){
  clazz=classMetaData.getDescribedType();
  this.columnFamilyName=mappingUtils.getColumnFamily(clazz);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str",classMetaData.getPrimaryKeyFields()[0].getType(),classMetaData.getPrimaryKeyFields()[0].getObjectIdFieldTypeCode());
  }
  this.keySerializer=MappingUtils.getSerializer(classMetaData.getPrimaryKeyFields()[0]);
  columnFieldIds=new HashMap<Integer,ColumnField<?>>();
  collectionFieldIds=new HashMap<Integer,AbstractCollectionField<?>>();
  this.mappingUtils=mappingUtils;
  FieldMetaData[] fmds=classMetaData.getFields();
  ColumnField<?> field=null;
  for (int i=0; i < fmds.length; i++) {
    if (fmds[i].getManagement() == FieldMetaData.MANAGE_NONE || fmds[i].isPrimaryKey()) {
      continue;
    }
    if (fmds[i].getAssociationType() == FieldMetaData.ONE_TO_MANY || fmds[i].getAssociationType() == FieldMetaData.MANY_TO_MANY) {
      AbstractCollectionField<?> collection=null;
      if (fmds[i].getOrders().length > 0) {
        collection=new OrderedCollectionField(fmds[i],mappingUtils);
      }
 else {
        collection=new UnorderedCollectionField(fmds[i],mappingUtils);
      }
      collectionFieldIds.put(collection.getFieldId(),collection);
      continue;
    }
    if (fmds[i].getAssociationType() == FieldMetaData.MANY_TO_ONE || fmds[i].getAssociationType() == FieldMetaData.ONE_TO_ONE) {
      ToOneColumnField<?> toOne=new ToOneColumnField(fmds[i],mappingUtils);
      columnFieldIds.put(i,toOne);
      continue;
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str",new Object[]{fmds[i].getName(),fmds[i].getTypeCode(),fmds[i].getAssociationType(),fmds[i].getDeclaredType().getName(),fmds[i].getElement().getDeclaredTypeMetaData()});
    }
    field=new ColumnField(fmds[i]);
    columnFieldIds.put(field.getFieldId(),field);
  }
  field=new StaticColumn();
  columnFieldIds.put(field.getFieldId(),field);
}

Fixed version (ground truth):
/** 
 * Default constructor
 * @param classMetaData The class meta data
 * @param mappingUtils The mapping utils to use for byte mapping
 */
public EntityFacade(ClassMetaData classMetaData,MappingUtils mappingUtils){
  clazz=classMetaData.getDescribedType();
  this.columnFamilyName=mappingUtils.getColumnFamily(clazz);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str",classMetaData.getPrimaryKeyFields()[0].getType(),classMetaData.getPrimaryKeyFields()[0].getObjectIdFieldTypeCode());
  }
  this.keySerializer=MappingUtils.getSerializer(classMetaData.getPrimaryKeyFields()[0]);
  columnFieldIds=new HashMap<Integer,ColumnField<?>>();
  collectionFieldIds=new HashMap<Integer,AbstractCollectionField<?>>();
  this.mappingUtils=mappingUtils;
  FieldMetaData[] fmds=classMetaData.getFields();
  ColumnField<?> field=null;
  for (int i=0; i < fmds.length; i++) {
    if (fmds[i].getManagement() == FieldMetaData.MANAGE_NONE || fmds[i].isPrimaryKey()) {
      continue;
    }
    if (fmds[i].getAssociationType() == FieldMetaData.ONE_TO_MANY || fmds[i].getAssociationType() == FieldMetaData.MANY_TO_MANY) {
      AbstractCollectionField<?> collection=null;
      if (fmds[i].getOrders().length > 0) {
        collection=new OrderedCollectionField(fmds[i],mappingUtils);
      }
 else {
        collection=new UnorderedCollectionField(fmds[i],mappingUtils);
      }
      collectionFieldIds.put(collection.getFieldId(),collection);
      continue;
    }
    if (fmds[i].getAssociationType() == FieldMetaData.MANY_TO_ONE || fmds[i].getAssociationType() == FieldMetaData.ONE_TO_ONE) {
      ToOneColumn<?> toOne=new ToOneColumn(fmds[i],mappingUtils);
      columnFieldIds.put(i,toOne);
      continue;
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str",new Object[]{fmds[i].getName(),fmds[i].getTypeCode(),fmds[i].getAssociationType(),fmds[i].getDeclaredType().getName(),fmds[i].getElement().getDeclaredTypeMetaData()});
    }
    field=new ColumnField(fmds[i]);
    columnFieldIds.put(field.getFieldId(),field);
  }
  field=new StaticColumn();
  columnFieldIds.put(field.getFieldId(),field);
}