Program: 175961
Project: 175961
Buggy source:
/** 
 * Gets the column list.
 * @param m the m
 * @param metamodel the metamodel
 * @param results the results
 * @param compoundKey the compound key
 * @return the column list
 */
List<String> getColumnList(EntityMetadata m,MetamodelImpl metamodel,String[] results,EmbeddableType compoundKey){
  List<String> columns=new ArrayList<String>();
  if (results != null && results.length > 0) {
    MetamodelImpl metaModel=(MetamodelImpl)kunderaMetadata.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
    EntityType entity=metaModel.entity(m.getEntityClazz());
    String keyFieldName=CassandraUtilities.getIdColumnName(kunderaMetadata,m,externalProperties,((CassandraClientBase)persistenceDelegeator.getClient(m)).isCql3Enabled(m));
    for (int i=1; i < results.length; i++) {
      if (results[i] != null) {
        if (results[i].indexOf("String_Node_Str") > 0) {
          String fieldName=results[i].substring(0,results[i].indexOf("String_Node_Str"));
          String embeddedFieldName=results[i].substring(results[i].indexOf("String_Node_Str") + 1,results[i].length());
          AbstractAttribute attribute=(AbstractAttribute)entity.getAttribute(fieldName);
          EmbeddableType embeddable=metamodel.embeddable(attribute.getBindableJavaType());
          Attribute embeddableAttribute=embeddable.getAttribute(embeddedFieldName);
          columns.add(((AbstractAttribute)embeddableAttribute).getJPAColumnName());
        }
 else {
          Attribute attribute=entity.getAttribute(results[i]);
          if (attribute == null) {
            throw new QueryHandlerException("String_Node_Str" + results);
          }
 else           if (m.getIdAttribute().equals(attribute) && compoundKey != null) {
            Field[] fields=m.getIdAttribute().getBindableJavaType().getDeclaredFields();
            for (            Field field : fields) {
              if (!ReflectUtils.isTransientOrStatic(field)) {
                Attribute compositeColumn=compoundKey.getAttribute(field.getName());
                columns.add(((AbstractAttribute)compositeColumn).getJPAColumnName());
              }
            }
          }
 else           if (m.getIdAttribute().equals(attribute) && compoundKey == null) {
            columns.add(keyFieldName);
          }
 else {
            columns.add(((AbstractAttribute)attribute).getJPAColumnName());
          }
        }
      }
    }
    return columns;
  }
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the column list.
 * @param m the m
 * @param metamodel the metamodel
 * @param results the results
 * @param compoundKey the compound key
 * @return the column list
 */
List<String> getColumnList(EntityMetadata m,MetamodelImpl metamodel,String[] results,EmbeddableType compoundKey){
  List<String> columns=new ArrayList<String>();
  if (results != null && results.length > 0) {
    MetamodelImpl metaModel=(MetamodelImpl)kunderaMetadata.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
    EntityType entity=metaModel.entity(m.getEntityClazz());
    String keyFieldName=CassandraUtilities.getIdColumnName(kunderaMetadata,m,externalProperties,((CassandraClientBase)persistenceDelegeator.getClient(m)).isCql3Enabled(m));
    for (int i=1; i < results.length; i++) {
      if (results[i] != null) {
        if (results[i].indexOf("String_Node_Str") > 0) {
          String fieldName=results[i].substring(0,results[i].indexOf("String_Node_Str"));
          String embeddedFieldName=results[i].substring(results[i].indexOf("String_Node_Str") + 1,results[i].length());
          AbstractAttribute attribute=(AbstractAttribute)entity.getAttribute(fieldName);
          EmbeddableType embeddable=metamodel.embeddable(attribute.getBindableJavaType());
          Attribute embeddableAttribute=embeddable.getAttribute(embeddedFieldName);
          columns.add(((AbstractAttribute)embeddableAttribute).getJPAColumnName());
        }
 else {
          Attribute attribute=entity.getAttribute(results[i]);
          if (attribute == null) {
            throw new QueryHandlerException("String_Node_Str" + results);
          }
 else           if (m.getIdAttribute().equals(attribute) && compoundKey != null) {
            Field[] fields=m.getIdAttribute().getBindableJavaType().getDeclaredFields();
            for (            Field field : fields) {
              addCompositeIdToColumns(metamodel,compoundKey,columns,field);
            }
          }
 else           if (m.getIdAttribute().equals(attribute) && compoundKey == null) {
            columns.add(keyFieldName);
          }
 else {
            columns.add(((AbstractAttribute)attribute).getJPAColumnName());
          }
        }
      }
    }
    return columns;
  }
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str");
  }
  return null;
}