Program: 176806
Project: 176806
Buggy source:
public void delete(Object entity,EntityMetadata metadata,ConsistencyLevel consistencyLevel){
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());
  if (CassandraIndexHelper.isInvertedIndexingApplicable(metadata)) {
    String indexColumnFamily=CassandraIndexHelper.getInvertedIndexTableName(metadata.getTableName());
    Map<String,EmbeddableType> embeddables=metaModel.getEmbeddables(metadata.getEntityClazz());
    EntityType entityType=metaModel.entity(metadata.getEntityClazz());
    for (    String fieldName : embeddables.keySet()) {
      EmbeddableType embeddedColumn=embeddables.get(fieldName);
      Attribute embeddedAttribute=entityType.getAttribute(fieldName);
      Object embeddedObject=PropertyAccessorHelper.getObject(entity,(Field)embeddedAttribute.getJavaMember());
      if (embeddedObject != null) {
        if (embeddedObject instanceof Collection) {
          for (          Object obj : (Collection)embeddedObject) {
            Iterator<Attribute> iter=embeddedColumn.getAttributes().iterator();
            while (iter.hasNext()) {
              Attribute attrib=iter.next();
              String rowKey=embeddedAttribute.getName() + Constants.INDEX_TABLE_ROW_KEY_DELIMITER + attrib.getName();
              byte[] columnName=PropertyAccessorHelper.get(obj,(Field)attrib.getJavaMember());
              if (columnName != null) {
                deleteColumn(indexColumnFamily,rowKey,columnName,metadata.getPersistenceUnit(),consistencyLevel);
              }
            }
          }
        }
 else {
          Iterator<Attribute> iter=embeddedColumn.getAttributes().iterator();
          while (iter.hasNext()) {
            Attribute attrib=iter.next();
            String rowKey=embeddedAttribute.getName() + Constants.INDEX_TABLE_ROW_KEY_DELIMITER + attrib.getName();
            byte[] columnName=PropertyAccessorHelper.get(embeddedObject,(Field)attrib.getJavaMember());
            if (columnName != null) {
              deleteColumn(indexColumnFamily,rowKey,columnName,metadata.getPersistenceUnit(),consistencyLevel);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void delete(Object entity,EntityMetadata metadata,ConsistencyLevel consistencyLevel){
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());
  if (CassandraIndexHelper.isInvertedIndexingApplicable(metadata)) {
    String indexColumnFamily=CassandraIndexHelper.getInvertedIndexTableName(metadata.getTableName());
    Map<String,EmbeddableType> embeddables=metaModel.getEmbeddables(metadata.getEntityClazz());
    EntityType entityType=metaModel.entity(metadata.getEntityClazz());
    byte[] columnName=PropertyAccessorHelper.get(entity,(Field)metadata.getIdAttribute().getJavaMember());
    for (    String fieldName : embeddables.keySet()) {
      EmbeddableType embeddedColumn=embeddables.get(fieldName);
      Attribute embeddedAttribute=entityType.getAttribute(fieldName);
      Object embeddedObject=PropertyAccessorHelper.getObject(entity,(Field)embeddedAttribute.getJavaMember());
      if (embeddedObject != null) {
        if (embeddedObject instanceof Collection) {
          for (          Object obj : (Collection)embeddedObject) {
            Iterator<Attribute> iter=embeddedColumn.getAttributes().iterator();
            while (iter.hasNext()) {
              Attribute attrib=iter.next();
              String rowKey=embeddedAttribute.getName() + Constants.INDEX_TABLE_ROW_KEY_DELIMITER + attrib.getName();
              byte[] superColumnName=PropertyAccessorHelper.get(obj,(Field)attrib.getJavaMember());
              if (superColumnName != null) {
                deleteColumn(indexColumnFamily,rowKey,superColumnName,metadata.getPersistenceUnit(),consistencyLevel,columnName);
              }
            }
          }
        }
 else {
          Iterator<Attribute> iter=embeddedColumn.getAttributes().iterator();
          while (iter.hasNext()) {
            Attribute attrib=iter.next();
            String rowKey=embeddedAttribute.getName() + Constants.INDEX_TABLE_ROW_KEY_DELIMITER + attrib.getName();
            byte[] superColumnName=PropertyAccessorHelper.get(embeddedObject,(Field)attrib.getJavaMember());
            if (superColumnName != null) {
              deleteColumn(indexColumnFamily,rowKey,superColumnName,metadata.getPersistenceUnit(),consistencyLevel,columnName);
            }
          }
        }
      }
    }
  }
}