Program: 111015
Project: 111015
Buggy source:
@Override public ExitCode exec(final BlazeRuntime runtime,final OptionsProvider optionsProvider){
  Options infoOptions=optionsProvider.getOptions(Options.class);
  OutErr outErr=runtime.getReporter().getOutErr();
  Supplier<BuildConfiguration> configurationSupplier=new Supplier<BuildConfiguration>(){
    private BuildConfiguration configuration;
    @Override public BuildConfiguration get(){
      if (configuration != null) {
        return configuration;
      }
      try {
        runtime.setupPackageCache(optionsProvider.getOptions(PackageCacheOptions.class),runtime.getDefaultsPackageContent(optionsProvider));
        configuration=runtime.getConfigurations(optionsProvider).getTargetConfigurations().get(0);
        return configuration;
      }
 catch (      InvalidConfigurationException e) {
        runtime.getReporter().handle(Event.error(e.getMessage()));
        throw new ExitCausingRuntimeException(ExitCode.COMMAND_LINE_ERROR);
      }
catch (      AbruptExitException e) {
        throw new ExitCausingRuntimeException("String_Node_Str" + e.getMessage(),e.getExitCode());
      }
catch (      InterruptedException e) {
        runtime.getReporter().handle(Event.error("String_Node_Str"));
        throw new ExitCausingRuntimeException(ExitCode.INTERRUPTED);
      }
    }
  }
;
  Map<String,BlazeModule.InfoItem> items=getInfoItemMap(runtime,optionsProvider);
  try {
    if (infoOptions.showMakeEnvironment) {
      Map<String,String> makeEnv=configurationSupplier.get().getMakeEnvironment();
      for (      Map.Entry<String,String> entry : makeEnv.entrySet()) {
        BlazeModule.InfoItem item=new MakeInfoItem(entry.getKey(),entry.getValue());
        items.put(item.getName(),item);
      }
    }
    List<String> residue=optionsProvider.getResidue();
    if (residue.size() > 1) {
      runtime.getReporter().handle(Event.error("String_Node_Str"));
      return ExitCode.COMMAND_LINE_ERROR;
    }
    String key=residue.size() == 1 ? residue.get(0) : null;
    if (key != null) {
      byte[] value;
      if (items.containsKey(key)) {
        value=items.get(key).get(configurationSupplier);
      }
 else {
        runtime.getReporter().handle(Event.error("String_Node_Str" + key + "String_Node_Str"));
        return ExitCode.COMMAND_LINE_ERROR;
      }
      try {
        outErr.getOutputStream().write(value);
        outErr.getOutputStream().flush();
      }
 catch (      IOException e) {
        runtime.getReporter().handle(Event.error("String_Node_Str" + e.getMessage()));
        return ExitCode.ANALYSIS_FAILURE;
      }
    }
 else {
      configurationSupplier.get();
      for (      BlazeModule.InfoItem infoItem : items.values()) {
        if (infoItem.isHidden()) {
          continue;
        }
        outErr.getOutputStream().write((infoItem.getName() + "String_Node_Str").getBytes(StandardCharsets.UTF_8));
        outErr.getOutputStream().write(infoItem.get(configurationSupplier));
      }
    }
  }
 catch (  AbruptExitException e) {
    return e.getExitCode();
  }
catch (  ExitCausingRuntimeException e) {
    return e.getExitCode();
  }
catch (  IOException e) {
    return ExitCode.LOCAL_ENVIRONMENTAL_ERROR;
  }
  return ExitCode.SUCCESS;
}

Fixed version (ground truth):
@Override public ExitCode exec(final BlazeRuntime runtime,final OptionsProvider optionsProvider){
  runtime.getReporter().switchToAnsiAllowingHandler();
  Options infoOptions=optionsProvider.getOptions(Options.class);
  OutErr outErr=runtime.getReporter().getOutErr();
  Supplier<BuildConfiguration> configurationSupplier=new Supplier<BuildConfiguration>(){
    private BuildConfiguration configuration;
    @Override public BuildConfiguration get(){
      if (configuration != null) {
        return configuration;
      }
      try {
        runtime.setupPackageCache(optionsProvider.getOptions(PackageCacheOptions.class),runtime.getDefaultsPackageContent(optionsProvider));
        configuration=runtime.getConfigurations(optionsProvider).getTargetConfigurations().get(0);
        return configuration;
      }
 catch (      InvalidConfigurationException e) {
        runtime.getReporter().handle(Event.error(e.getMessage()));
        throw new ExitCausingRuntimeException(ExitCode.COMMAND_LINE_ERROR);
      }
catch (      AbruptExitException e) {
        throw new ExitCausingRuntimeException("String_Node_Str" + e.getMessage(),e.getExitCode());
      }
catch (      InterruptedException e) {
        runtime.getReporter().handle(Event.error("String_Node_Str"));
        throw new ExitCausingRuntimeException(ExitCode.INTERRUPTED);
      }
    }
  }
;
  Map<String,BlazeModule.InfoItem> items=getInfoItemMap(runtime,optionsProvider);
  try {
    if (infoOptions.showMakeEnvironment) {
      Map<String,String> makeEnv=configurationSupplier.get().getMakeEnvironment();
      for (      Map.Entry<String,String> entry : makeEnv.entrySet()) {
        BlazeModule.InfoItem item=new MakeInfoItem(entry.getKey(),entry.getValue());
        items.put(item.getName(),item);
      }
    }
    List<String> residue=optionsProvider.getResidue();
    if (residue.size() > 1) {
      runtime.getReporter().handle(Event.error("String_Node_Str"));
      return ExitCode.COMMAND_LINE_ERROR;
    }
    String key=residue.size() == 1 ? residue.get(0) : null;
    if (key != null) {
      byte[] value;
      if (items.containsKey(key)) {
        value=items.get(key).get(configurationSupplier);
      }
 else {
        runtime.getReporter().handle(Event.error("String_Node_Str" + key + "String_Node_Str"));
        return ExitCode.COMMAND_LINE_ERROR;
      }
      try {
        outErr.getOutputStream().write(value);
        outErr.getOutputStream().flush();
      }
 catch (      IOException e) {
        runtime.getReporter().handle(Event.error("String_Node_Str" + e.getMessage()));
        return ExitCode.ANALYSIS_FAILURE;
      }
    }
 else {
      configurationSupplier.get();
      for (      BlazeModule.InfoItem infoItem : items.values()) {
        if (infoItem.isHidden()) {
          continue;
        }
        outErr.getOutputStream().write((infoItem.getName() + "String_Node_Str").getBytes(StandardCharsets.UTF_8));
        outErr.getOutputStream().write(infoItem.get(configurationSupplier));
      }
    }
  }
 catch (  AbruptExitException e) {
    return e.getExitCode();
  }
catch (  ExitCausingRuntimeException e) {
    return e.getExitCode();
  }
catch (  IOException e) {
    return ExitCode.LOCAL_ENVIRONMENTAL_ERROR;
  }
  return ExitCode.SUCCESS;
}