Program: 113743
Project: 113743
Buggy source:
public static void main(String[] args) throws Exception {
  Logging.start(Logging.LEVEL_WARN);
  System.out.println("String_Node_Str" + OSDRequestDispatcher.VERSION + "String_Node_Str");
  Map<String,CliOption> options=new HashMap<String,CliOption>();
  List<String> arguments=new ArrayList<String>(1);
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.SWITCH));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.URL));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.SWITCH));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.NUMBER));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.STRING));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.STRING));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.STRING));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.STRING));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.SWITCH));
  CLIParser.parseCLI(args,options,arguments);
  if (arguments.size() != 1 || options.get("String_Node_Str").switchValue == true) {
    usage();
    return;
  }
  InetSocketAddress dirAddr=null;
  boolean useSSL=false;
  String serviceCredsFile=null;
  String serviceCredsPass=null;
  String trustedCAsFile=null;
  String trustedCAsPass=null;
  ONCRPCServiceURL dirURL=options.get("String_Node_Str").urlValue;
  if (dirURL != null && "String_Node_Str".equals(dirURL.getProtocol())) {
    useSSL=true;
    serviceCredsFile=options.get("String_Node_Str").stringValue;
    serviceCredsPass=options.get("String_Node_Str").stringValue;
    trustedCAsFile=options.get("String_Node_Str").stringValue;
    trustedCAsPass=options.get("String_Node_Str").stringValue;
  }
  if (dirURL == null) {
    DefaultDirConfig cfg=new DefaultDirConfig(DEFAULT_DIR_CONFIG);
    cfg.read();
    dirAddr=cfg.getDirectoryService();
    useSSL=cfg.isSslEnabled();
    serviceCredsFile=cfg.getServiceCredsFile();
    serviceCredsPass=cfg.getServiceCredsPassphrase();
    trustedCAsFile=cfg.getTrustedCertsFile();
    trustedCAsPass=cfg.getTrustedCertsPassphrase();
  }
 else   dirAddr=new InetSocketAddress(dirURL.getHost(),dirURL.getPort());
  boolean checkOnly=options.get("String_Node_Str").switchValue;
  int numThreads=DEFAULT_NUM_THREADS;
  if (options.get("String_Node_Str").numValue != null)   numThreads=options.get("String_Node_Str").numValue.intValue();
  String volume=arguments.get(0);
  boolean isVolUUID=false;
  if (volume.startsWith("String_Node_Str")) {
    volume=volume.substring("String_Node_Str".length());
    isVolUUID=true;
  }
  SSLOptions sslOptions=useSSL ? new SSLOptions(new FileInputStream(serviceCredsFile),serviceCredsPass,SSLOptions.PKCS12_CONTAINER,new FileInputStream(trustedCAsFile),trustedCAsPass,SSLOptions.JKS_CONTAINER,false) : null;
  RPCNIOSocketClient rpcClient=new RPCNIOSocketClient(sslOptions,30000,5 * 60000);
  rpcClient.start();
  rpcClient.waitForStartup();
  DIRClient dirClient=new DIRClient(rpcClient,dirAddr);
  TimeSync.initialize(dirClient,100000,50).waitForStartup();
  RPCResponse<ServiceRegistrySet> resp=dirClient.service_get_by_type(null,Constants.SERVICE_TYPE_VOLUME);
  ServiceRegistrySet result=resp.get();
  resp.freeBuffers();
  ServiceRegistry volReg=null;
  if (isVolUUID) {
    for (    ServiceRegistry reg : result) {
      if (reg.getUuid().equals(volume))       volReg=reg;
    }
  }
 else {
    for (    ServiceRegistry reg : result) {
      if (reg.getService_name().equals(volume))       volReg=reg;
    }
  }
  if (volReg == null) {
    System.err.println("String_Node_Str" + arguments.get(0) + "String_Node_Str"+ dirURL+ "String_Node_Str");
    System.exit(3);
  }
  volume=volReg.getService_name();
  String mrc=null;
  for (  KeyValuePair kv : volReg.getData()) {
    if (kv.getKey().equals("String_Node_Str"))     mrc=kv.getValue();
  }
  if (mrc == null) {
    System.err.println("String_Node_Str" + arguments.get(0) + "String_Node_Str");
    System.exit(3);
  }
  UUIDResolver.start(dirClient,60 * 60,10 * 60 * 60);
  ServiceUUID mrcUUID=new ServiceUUID(mrc);
  InetSocketAddress mrcAddress=mrcUUID.getAddress();
  int exitCode=1;
  try {
    Scrubber scrubber=new Scrubber(rpcClient,dirClient,new MRCClient(rpcClient,mrcAddress),volume,checkOnly,numThreads);
    exitCode=scrubber.scrub();
    if (exitCode == 0)     System.out.println("String_Node_Str" + volume + "String_Node_Str");
 else     System.out.println("String_Node_Str" + volume + "String_Node_Str");
    System.exit(exitCode);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  TimeSync.close();
  UUIDResolver.shutdown();
  rpcClient.shutdown();
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  Logging.start(Logging.LEVEL_WARN);
  System.out.println("String_Node_Str" + OSDRequestDispatcher.VERSION + "String_Node_Str");
  Map<String,CliOption> options=new HashMap<String,CliOption>();
  List<String> arguments=new ArrayList<String>(1);
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.SWITCH));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.URL));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.SWITCH));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.NUMBER));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.STRING));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.STRING));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.STRING));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.STRING));
  options.put("String_Node_Str",new CliOption(CliOption.OPTIONTYPE.SWITCH));
  CLIParser.parseCLI(args,options,arguments);
  if (arguments.size() != 1 || options.get("String_Node_Str").switchValue == true) {
    usage();
    return;
  }
  InetSocketAddress dirAddr=null;
  boolean useSSL=false;
  String serviceCredsFile=null;
  String serviceCredsPass=null;
  String trustedCAsFile=null;
  String trustedCAsPass=null;
  ONCRPCServiceURL dirURL=options.get("String_Node_Str").urlValue;
  if (dirURL != null && "String_Node_Str".equals(dirURL.getProtocol())) {
    useSSL=true;
    serviceCredsFile=options.get("String_Node_Str").stringValue;
    serviceCredsPass=options.get("String_Node_Str").stringValue;
    trustedCAsFile=options.get("String_Node_Str").stringValue;
    trustedCAsPass=options.get("String_Node_Str").stringValue;
  }
  if (dirURL == null) {
    DefaultDirConfig cfg=new DefaultDirConfig(DEFAULT_DIR_CONFIG);
    cfg.read();
    dirAddr=cfg.getDirectoryService();
    useSSL=cfg.isSslEnabled();
    serviceCredsFile=cfg.getServiceCredsFile();
    serviceCredsPass=cfg.getServiceCredsPassphrase();
    trustedCAsFile=cfg.getTrustedCertsFile();
    trustedCAsPass=cfg.getTrustedCertsPassphrase();
  }
 else   dirAddr=new InetSocketAddress(dirURL.getHost(),dirURL.getPort());
  boolean checkOnly=options.get("String_Node_Str").switchValue;
  int numThreads=DEFAULT_NUM_THREADS;
  if (options.get("String_Node_Str").numValue != null)   numThreads=options.get("String_Node_Str").numValue.intValue();
  String volume=arguments.get(0);
  boolean isVolUUID=false;
  if (volume.startsWith("String_Node_Str")) {
    volume=volume.substring("String_Node_Str".length());
    isVolUUID=true;
  }
  SSLOptions sslOptions=useSSL ? new SSLOptions(new FileInputStream(serviceCredsFile),serviceCredsPass,SSLOptions.PKCS12_CONTAINER,new FileInputStream(trustedCAsFile),trustedCAsPass,SSLOptions.JKS_CONTAINER,false) : null;
  RPCNIOSocketClient rpcClient=new RPCNIOSocketClient(sslOptions,30000,5 * 60000);
  rpcClient.start();
  rpcClient.waitForStartup();
  DIRClient dirClient=new DIRClient(rpcClient,dirAddr);
  TimeSync.initialize(dirClient,100000,50).waitForStartup();
  RPCResponse<ServiceRegistrySet> resp=dirClient.service_get_by_type(null,Constants.SERVICE_TYPE_VOLUME);
  ServiceRegistrySet result=resp.get();
  resp.freeBuffers();
  ServiceRegistry volReg=null;
  if (isVolUUID) {
    for (    ServiceRegistry reg : result) {
      if (reg.getUuid().equals(volume))       volReg=reg;
    }
  }
 else {
    for (    ServiceRegistry reg : result) {
      if (reg.getService_name().equals(volume))       volReg=reg;
    }
  }
  if (volReg == null) {
    System.err.println("String_Node_Str" + arguments.get(0) + "String_Node_Str"+ dirURL+ "String_Node_Str");
    System.exit(3);
  }
  volume=volReg.getService_name();
  String mrc=volReg.getData().get("String_Node_Str");
  if (mrc == null) {
    System.err.println("String_Node_Str" + arguments.get(0) + "String_Node_Str");
    System.exit(3);
  }
  UUIDResolver.start(dirClient,60 * 60,10 * 60 * 60);
  ServiceUUID mrcUUID=new ServiceUUID(mrc);
  InetSocketAddress mrcAddress=mrcUUID.getAddress();
  int exitCode=1;
  try {
    Scrubber scrubber=new Scrubber(rpcClient,dirClient,new MRCClient(rpcClient,mrcAddress),volume,checkOnly,numThreads);
    exitCode=scrubber.scrub();
    if (exitCode == 0)     System.out.println("String_Node_Str" + volume + "String_Node_Str");
 else     System.out.println("String_Node_Str" + volume + "String_Node_Str");
    System.exit(exitCode);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  TimeSync.close();
  UUIDResolver.shutdown();
  rpcClient.shutdown();
}