Program: 5608
Project: 5608
Buggy source:
/** 
 * Performs most of the validation and configuration needed by a pipeline. Handles stages, connections, resources, and stage logging settings.
 * @param config user provided ETL config
 * @param specBuilder builder for creating a pipeline spec.
 */
protected void configureStages(ETLConfig config,PipelineSpec.Builder specBuilder){
  List<StageConnections> traversalOrder=validateConfig(config);
  Map<String,DefaultPipelineConfigurer> pluginConfigurers=new HashMap<>(traversalOrder.size());
  Map<String,String> pluginTypes=new HashMap<>(traversalOrder.size());
  for (  StageConnections stageConnections : traversalOrder) {
    String stageName=stageConnections.getStage().getName();
    pluginTypes.put(stageName,stageConnections.getStage().getPlugin().getType());
    pluginConfigurers.put(stageName,new DefaultPipelineConfigurer(configurer,stageName));
  }
  for (  StageConnections stageConnections : traversalOrder) {
    ETLStage stage=stageConnections.getStage();
    String stageName=stage.getName();
    DefaultPipelineConfigurer pluginConfigurer=pluginConfigurers.get(stageName);
    StageSpec stageSpec=configureStage(stageConnections,pluginConfigurer);
    Schema outputSchema=stageSpec.getOutputSchema();
    for (    String outputStageName : stageConnections.getOutputs()) {
      pluginConfigurers.get(outputStageName).getStageConfigurer().addInputSchema(pluginTypes.get(outputStageName),stageName,outputSchema);
    }
    specBuilder.addStage(stageSpec);
  }
  specBuilder.addConnections(config.getConnections()).setResources(config.getResources()).setStageLoggingEnabled(config.isStageLoggingEnabled()).setNumOfRecordsPreview(config.getNumOfRecordsPreview());
}

Fixed version (ground truth):
/** 
 * Performs most of the validation and configuration needed by a pipeline. Handles stages, connections, resources, and stage logging settings.
 * @param config user provided ETL config
 * @param specBuilder builder for creating a pipeline spec.
 */
protected void configureStages(ETLConfig config,PipelineSpec.Builder specBuilder){
  List<StageConnections> traversalOrder=validateConfig(config);
  Map<String,DefaultPipelineConfigurer> pluginConfigurers=new HashMap<>(traversalOrder.size());
  Map<String,String> pluginTypes=new HashMap<>(traversalOrder.size());
  for (  StageConnections stageConnections : traversalOrder) {
    String stageName=stageConnections.getStage().getName();
    pluginTypes.put(stageName,stageConnections.getStage().getPlugin().getType());
    pluginConfigurers.put(stageName,new DefaultPipelineConfigurer(configurer,stageName));
  }
  for (  StageConnections stageConnections : traversalOrder) {
    ETLStage stage=stageConnections.getStage();
    String stageName=stage.getName();
    DefaultPipelineConfigurer pluginConfigurer=pluginConfigurers.get(stageName);
    StageSpec stageSpec=configureStage(stageConnections,pluginConfigurer);
    Schema outputSchema=stageSpec.getOutputSchema();
    for (    String outputStageName : stageConnections.getOutputs()) {
      String outputStageType=pluginTypes.get(outputStageName);
      if (Action.PLUGIN_TYPE.equals(outputStageType)) {
        continue;
      }
      DefaultStageConfigurer outputStageConfigurer=pluginConfigurers.get(outputStageName).getStageConfigurer();
      if (BatchJoiner.PLUGIN_TYPE.equals(outputStageType) && outputSchema == null) {
        throw new IllegalArgumentException(String.format("String_Node_Str" + "String_Node_Str",stageName));
      }
      if (!outputStageType.equals(BatchJoiner.PLUGIN_TYPE) && !hasSameSchema(outputStageConfigurer.getInputSchemas(),outputSchema)) {
        throw new IllegalArgumentException("String_Node_Str" + outputStageName);
      }
      outputStageConfigurer.addInputSchema(stageName,outputSchema);
    }
    specBuilder.addStage(stageSpec);
  }
  specBuilder.addConnections(config.getConnections()).setResources(config.getResources()).setStageLoggingEnabled(config.isStageLoggingEnabled()).setNumOfRecordsPreview(config.getNumOfRecordsPreview());
}