Program: 176766
Project: 176766
Buggy source:
@Override public void configure(){
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  puToSchemaMetadata=appMetadata.getSchemaMetadata().getPuToSchemaMetadata();
  for (  String persistenceUnit : persistenceUnits) {
    if (getSchemaProperty(persistenceUnit) != null) {
      log.info("String_Node_Str" + persistenceUnit);
      List<TableInfo> tableInfos=getSchemaInfo(persistenceUnit);
      Map<Class<?>,EntityMetadata> entityMetadataMap=getEntityMetadataCol(appMetadata,persistenceUnit);
      for (      EntityMetadata entityMetadata : entityMetadataMap.values()) {
        boolean found=false;
        Type type=entityMetadata.getType();
        Class idClassName=entityMetadata.getIdAttribute().getJavaType();
        TableInfo tableInfo=new TableInfo(entityMetadata.getTableName(),entityMetadata.isIndexable(),type.name(),idClassName);
        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);
        }
      }
      puToSchemaMetadata.put(persistenceUnit,tableInfos);
      SchemaManager schemaManager=ClientResolver.getClientFactory(persistenceUnit).getSchemaManager();
      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<Class<?>,EntityMetadata> entityMetadataMap=getEntityMetadataCol(appMetadata,persistenceUnit);
    for (    EntityMetadata entityMetadata : entityMetadataMap.values()) {
      boolean found=false;
      Type type=entityMetadata.getType();
      Class idClassName=entityMetadata.getIdAttribute().getJavaType();
      TableInfo tableInfo=new TableInfo(entityMetadata.getTableName(),entityMetadata.isIndexable(),type.name(),idClassName);
      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);
      }
    }
    puToSchemaMetadata.put(persistenceUnit,tableInfos);
    if (getSchemaProperty(persistenceUnit) != null) {
      ClientFactory clientFactory=ClientResolver.getClientFactory(persistenceUnit);
      SchemaManager schemaManager=clientFactory != null ? clientFactory.getSchemaManager() : null;
      if (schemaManager != null) {
        schemaManager.exportSchema();
      }
    }
  }
}