Program: 176516
Project: 176516
Buggy source:
@Override public void configure(){
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  puToSchemaMetadata=appMetadata.getSchemaMetadata().getPuToSchemaMetadata();
  for (  String persistenceUnit : persistenceUnits) {
    log.info("String_Node_Str" + persistenceUnit);
    List<TableInfo> tableInfos=getSchemaInfo(persistenceUnit);
    Map<String,EntityMetadata> entityMetadataMap=getEntityMetadataCol(appMetadata,persistenceUnit);
    for (    EntityMetadata entityMetadata : entityMetadataMap.values()) {
      boolean found=false;
      Type type=entityMetadata.getType();
      Class idClassName=entityMetadata.getIdAttribute() != null ? entityMetadata.getIdAttribute().getJavaType() : null;
      String idName=entityMetadata.getIdAttribute() != null ? ((AbstractAttribute)entityMetadata.getIdAttribute()).getJPAColumnName() : null;
      boolean isCompositeId=idClassName.isAnnotationPresent(Embeddable.class);
      TableInfo tableInfo=new TableInfo(entityMetadata.getTableName(),entityMetadata.isIndexable(),type.name(),idClassName,idName,isCompositeId);
      if (!tableInfos.isEmpty() && tableInfos.contains(tableInfo)) {
        found=true;
        int idx=tableInfos.indexOf(tableInfo);
        tableInfo=tableInfos.get(idx);
        addColumnToTableInfo(entityMetadata,type,tableInfo);
      }
 else {
        addColumnToTableInfo(entityMetadata,type,tableInfo);
      }
      List<Relation> relations=entityMetadata.getRelations();
      parseRelations(persistenceUnit,tableInfos,entityMetadata,tableInfo,relations);
      if (!found) {
        tableInfos.add(tableInfo);
      }
      addTableGenerator(appMetadata,persistenceUnit,tableInfos,entityMetadata,idClassName,idName,isCompositeId);
    }
    puToSchemaMetadata.put(persistenceUnit,tableInfos);
  }
  for (  String persistenceUnit : persistenceUnits) {
    Map<String,Object> externalProperties=KunderaCoreUtils.getExternalProperties(persistenceUnit,externalPropertyMap,persistenceUnits);
    if (getSchemaProperty(persistenceUnit,externalProperties) != null && !getSchemaProperty(persistenceUnit,externalProperties).isEmpty()) {
      ClientFactory clientFactory=ClientResolver.getClientFactory(persistenceUnit);
      SchemaManager schemaManager=clientFactory != null ? clientFactory.getSchemaManager(externalProperties) : null;
      if (schemaManager != null) {
        schemaManager.exportSchema();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void configure(){
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  puToSchemaMetadata=appMetadata.getSchemaMetadata().getPuToSchemaMetadata();
  for (  String persistenceUnit : persistenceUnits) {
    log.info("String_Node_Str" + persistenceUnit);
    List<TableInfo> tableInfos=getSchemaInfo(persistenceUnit);
    Map<String,EntityMetadata> entityMetadataMap=getEntityMetadataCol(appMetadata,persistenceUnit);
    for (    EntityMetadata entityMetadata : entityMetadataMap.values()) {
      boolean found=false;
      Type type=entityMetadata.getType();
      Class idClassName=entityMetadata.getIdAttribute() != null ? entityMetadata.getIdAttribute().getJavaType() : null;
      String idName=entityMetadata.getIdAttribute() != null ? ((AbstractAttribute)entityMetadata.getIdAttribute()).getJPAColumnName() : null;
      TableInfo tableInfo=new TableInfo(entityMetadata.getTableName(),type.name(),idClassName,idName);
      if (!tableInfos.isEmpty() && tableInfos.contains(tableInfo)) {
        found=true;
        int idx=tableInfos.indexOf(tableInfo);
        tableInfo=tableInfos.get(idx);
        addColumnToTableInfo(entityMetadata,type,tableInfo);
      }
 else {
        addColumnToTableInfo(entityMetadata,type,tableInfo);
      }
      List<Relation> relations=entityMetadata.getRelations();
      parseRelations(persistenceUnit,tableInfos,entityMetadata,tableInfo,relations);
      if (!found) {
        tableInfos.add(tableInfo);
      }
      addTableGenerator(appMetadata,persistenceUnit,tableInfos,entityMetadata,idClassName,idName);
    }
    puToSchemaMetadata.put(persistenceUnit,tableInfos);
  }
  for (  String persistenceUnit : persistenceUnits) {
    Map<String,Object> externalProperties=KunderaCoreUtils.getExternalProperties(persistenceUnit,externalPropertyMap,persistenceUnits);
    if (getSchemaProperty(persistenceUnit,externalProperties) != null && !getSchemaProperty(persistenceUnit,externalProperties).isEmpty()) {
      ClientFactory clientFactory=ClientResolver.getClientFactory(persistenceUnit);
      SchemaManager schemaManager=clientFactory != null ? clientFactory.getSchemaManager(externalProperties) : null;
      if (schemaManager != null) {
        schemaManager.exportSchema();
      }
    }
  }
}