Program: 4703
Project: 4703
Buggy source:
/** 
 * Configures a stage and returns the spec for it.
 * @param stage the user provided configuration for the stage
 * @param validatedPipeline the validated pipeline config
 * @param pluginConfigurer configurer used to configure the stage
 * @return the spec for the stage
 */
private ConfiguredStage configureStage(ETLStage stage,ValidatedPipeline validatedPipeline,DefaultPipelineConfigurer pluginConfigurer){
  String stageName=stage.getName();
  ETLPlugin stagePlugin=stage.getPlugin();
  if (!Strings.isNullOrEmpty(stage.getErrorDatasetName())) {
    configurer.createDataset(stage.getErrorDatasetName(),errorDatasetClass,errorDatasetProperties);
  }
  PluginSpec pluginSpec=configurePlugin(stageName,stagePlugin,pluginConfigurer);
  DefaultStageConfigurer stageConfigurer=pluginConfigurer.getStageConfigurer();
  Map<String,StageSpec.Port> outputSchemas=new HashMap<>();
  if (pluginSpec.getType().equals(SplitterTransform.PLUGIN_TYPE)) {
    Map<String,Schema> outputPortSchemas=stageConfigurer.getOutputPortSchemas();
    for (    Map.Entry<String,String> outputEntry : validatedPipeline.getOutputPorts(stageName).entrySet()) {
      String outputStage=outputEntry.getKey();
      String outputPort=outputEntry.getValue();
      if (outputPort == null) {
        throw new IllegalArgumentException(String.format("String_Node_Str",stageName,outputStage));
      }
      outputSchemas.put(outputStage,new StageSpec.Port(outputPort,outputPortSchemas.get(outputPort)));
    }
  }
 else {
    Schema outputSchema=stageConfigurer.getOutputSchema();
    for (    String outputStage : validatedPipeline.getOutputs(stageName)) {
      outputSchemas.put(outputStage,new StageSpec.Port(null,outputSchema));
    }
  }
  Map<String,Schema> inputSchemas=stageConfigurer.getInputSchemas();
  StageSpec stageSpec=StageSpec.builder(stageName,pluginSpec).setErrorDatasetName(stage.getErrorDatasetName()).addInputSchemas(inputSchemas).addOutputPortSchemas(outputSchemas).setErrorSchema(stageConfigurer.getErrorSchema()).setProcessTimingEnabled(validatedPipeline.isProcessTimingEnabled()).setStageLoggingEnabled(validatedPipeline.isStageLoggingEnabled()).build();
  return new ConfiguredStage(stageSpec,pluginConfigurer.getPipelineProperties());
}

Fixed version (ground truth):
/** 
 * Configures a stage and returns the spec for it.
 * @param stage the user provided configuration for the stage
 * @param validatedPipeline the validated pipeline config
 * @param pluginConfigurer configurer used to configure the stage
 * @return the spec for the stage
 */
private ConfiguredStage configureStage(ETLStage stage,ValidatedPipeline validatedPipeline,DefaultPipelineConfigurer pluginConfigurer){
  String stageName=stage.getName();
  ETLPlugin stagePlugin=stage.getPlugin();
  if (!Strings.isNullOrEmpty(stage.getErrorDatasetName())) {
    configurer.createDataset(stage.getErrorDatasetName(),errorDatasetClass,errorDatasetProperties);
  }
  PluginSpec pluginSpec=configurePlugin(stageName,stagePlugin,pluginConfigurer);
  DefaultStageConfigurer stageConfigurer=pluginConfigurer.getStageConfigurer();
  Map<String,StageSpec.Port> outputSchemas=new HashMap<>();
  Map<String,Schema> inputSchemas=stageConfigurer.getInputSchemas();
  if (pluginSpec.getType().equals(SplitterTransform.PLUGIN_TYPE)) {
    Map<String,Schema> outputPortSchemas=stageConfigurer.getOutputPortSchemas();
    for (    Map.Entry<String,String> outputEntry : validatedPipeline.getOutputPorts(stageName).entrySet()) {
      String outputStage=outputEntry.getKey();
      String outputPort=outputEntry.getValue();
      if (outputPort == null) {
        throw new IllegalArgumentException(String.format("String_Node_Str",stageName,outputStage));
      }
      outputSchemas.put(outputStage,new StageSpec.Port(outputPort,outputPortSchemas.get(outputPort)));
    }
  }
 else {
    Schema outputSchema=stageConfigurer.getOutputSchema();
    if (Condition.PLUGIN_TYPE.equals(pluginSpec.getType())) {
      outputSchema=null;
      for (      Schema schema : inputSchemas.values()) {
        if (schema != null) {
          if (outputSchema != null && !outputSchema.equals(schema)) {
            throw new IllegalArgumentException("String_Node_Str" + stageName);
          }
          outputSchema=schema;
        }
      }
    }
    for (    String outputStage : validatedPipeline.getOutputs(stageName)) {
      outputSchemas.put(outputStage,new StageSpec.Port(null,outputSchema));
    }
  }
  StageSpec stageSpec=StageSpec.builder(stageName,pluginSpec).setErrorDatasetName(stage.getErrorDatasetName()).addInputSchemas(inputSchemas).addOutputPortSchemas(outputSchemas).setErrorSchema(stageConfigurer.getErrorSchema()).setProcessTimingEnabled(validatedPipeline.isProcessTimingEnabled()).setStageLoggingEnabled(validatedPipeline.isStageLoggingEnabled()).build();
  return new ConfiguredStage(stageSpec,pluginConfigurer.getPipelineProperties());
}