Program: 176112
Project: 176112
Buggy source:
/** 
 * On column or super column thrift row.
 * @param tr the tr
 * @param m the m
 * @param e the e
 * @param id the id
 * @param timestamp the timestamp2
 * @param columnTTLs TODO
 */
private Collection<ThriftRow> onColumnOrSuperColumnThriftRow(EntityMetadata m,Object e,Object id,long timestamp,Object columnTTLs){
  Map<String,ThriftRow> thriftRows=new HashMap<String,ThriftRow>();
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
  EntityType entityType=metaModel.entity(m.getEntityClazz());
  Set<Attribute> attributes=entityType.getAttributes();
  for (  Attribute attribute : attributes) {
    String tableName=((AbstractAttribute)attribute).getTableName() != null ? ((AbstractAttribute)attribute).getTableName() : m.getTableName();
    ThriftRow tr=getThriftRow(id,tableName,thriftRows);
    if (!attribute.getName().equals(m.getIdAttribute().getName()) && !attribute.isAssociation()) {
      Field field=(Field)((Attribute)attribute).getJavaMember();
      byte[] name=PropertyAccessorFactory.STRING.toBytes(((AbstractAttribute)attribute).getJPAColumnName());
      if (metaModel.isEmbeddable(attribute.isCollection() ? ((PluralAttribute)attribute).getBindableJavaType() : attribute.getJavaType())) {
        Map<String,Object> thriftSuperColumns=onEmbeddable(timestamp,tr,m,e,id,attribute);
        if (thriftSuperColumns != null) {
          for (          String columnFamilyName : thriftSuperColumns.keySet()) {
            ThriftRow thriftRow=getThriftRow(id,columnFamilyName,thriftRows);
            if (m.isCounterColumnType()) {
              thriftRow.addCounterSuperColumn((CounterSuperColumn)thriftSuperColumns.get(columnFamilyName));
            }
 else {
              thriftRow.addSuperColumn((SuperColumn)thriftSuperColumns.get(columnFamilyName));
            }
          }
        }
      }
 else {
        Object value=getColumnValue(m,e,attribute);
        if (m.getType().equals(Type.SUPER_COLUMN_FAMILY)) {
          prepareSuperColumn(tr,m,value,name,timestamp);
        }
 else {
          int ttl=getTTLForColumn(columnTTLs,attribute);
          prepareColumn(tr,m,value,name,timestamp,ttl);
        }
      }
    }
  }
  onDiscriminatorColumn(thriftRows.get(m.getTableName()),timestamp,entityType);
  return thriftRows.values();
}

Fixed version (ground truth):
/** 
 * On column or super column thrift row.
 * @param tr the tr
 * @param m the m
 * @param e the e
 * @param id the id
 * @param timestamp the timestamp2
 * @param columnTTLs TODO
 */
private Collection<ThriftRow> onColumnOrSuperColumnThriftRow(EntityMetadata m,Object e,Object id,long timestamp,Object columnTTLs){
  Map<String,ThriftRow> thriftRows=new HashMap<String,ThriftRow>();
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
  EntityType entityType=metaModel.entity(m.getEntityClazz());
  Set<Attribute> attributes=entityType.getAttributes();
  for (  Attribute attribute : attributes) {
    String tableName=((AbstractAttribute)attribute).getTableName() != null ? ((AbstractAttribute)attribute).getTableName() : m.getTableName();
    ThriftRow tr=getThriftRow(id,tableName,thriftRows);
    if (!attribute.getName().equals(m.getIdAttribute().getName()) && !attribute.isAssociation()) {
      Field field=(Field)((Attribute)attribute).getJavaMember();
      byte[] name=ByteBufferUtil.bytes(((AbstractAttribute)attribute).getJPAColumnName()).array();
      if (metaModel.isEmbeddable(attribute.isCollection() ? ((PluralAttribute)attribute).getBindableJavaType() : attribute.getJavaType())) {
        Map<String,Object> thriftSuperColumns=onEmbeddable(timestamp,tr,m,e,id,attribute);
        if (thriftSuperColumns != null) {
          for (          String columnFamilyName : thriftSuperColumns.keySet()) {
            ThriftRow thriftRow=getThriftRow(id,columnFamilyName,thriftRows);
            if (m.isCounterColumnType()) {
              thriftRow.addCounterSuperColumn((CounterSuperColumn)thriftSuperColumns.get(columnFamilyName));
            }
 else {
              thriftRow.addSuperColumn((SuperColumn)thriftSuperColumns.get(columnFamilyName));
            }
          }
        }
      }
 else {
        Object value=getColumnValue(m,e,attribute);
        if (m.getType().equals(Type.SUPER_COLUMN_FAMILY)) {
          prepareSuperColumn(tr,m,value,name,timestamp);
        }
 else {
          int ttl=getTTLForColumn(columnTTLs,attribute);
          prepareColumn(tr,m,value,name,timestamp,ttl);
        }
      }
    }
  }
  onDiscriminatorColumn(thriftRows.get(m.getTableName()),timestamp,entityType);
  return thriftRows.values();
}