Program: 113644
Project: 113644
Buggy source:
public static void main(String[] args){
  try {
    Map<String,CliOption> options=new HashMap<String,CliOption>();
    List<String> arguments=new ArrayList<String>(2);
    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.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);
    Logging.start(Logging.LEVEL_WARN);
    TimeSync.initialize(null,10000,50);
    if (arguments.size() != 2) {
      usage();
      return;
    }
    final ONCRPCServiceURL mrcURL=new ONCRPCServiceURL(arguments.get(1));
    final String path=(options.get("String_Node_Str").stringValue != null) ? options.get("String_Node_Str").stringValue : "String_Node_Str";
    final String volname=(options.get("String_Node_Str").stringValue != null) ? options.get("String_Node_Str").stringValue : "String_Node_Str";
    final ONCRPCServiceURL dirURL=new ONCRPCServiceURL(arguments.get(0));
    boolean useSSL=false;
    final SSLOptions sslOptions;
    if (dirURL.getProtocol().equalsIgnoreCase("String_Node_Str")) {
      String serviceCredsFile=null;
      String serviceCredsPass=null;
      String trustedCAsFile=null;
      String trustedCAsPass=null;
      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;
      sslOptions=new SSLOptions(new FileInputStream(serviceCredsFile),serviceCredsPass,SSLOptions.PKCS12_CONTAINER,new FileInputStream(trustedCAsFile),trustedCAsPass,SSLOptions.JKS_CONTAINER,false);
      System.out.println("String_Node_Str");
    }
 else {
      sslOptions=null;
    }
    RPCNIOSocketClient rpcClient=new RPCNIOSocketClient(sslOptions,10000,5 * 60 * 1000);
    rpcClient.start();
    rpcClient.waitForStartup();
    DIRClient dir=new DIRClient(rpcClient,new InetSocketAddress(dirURL.getHost(),dirURL.getPort()));
    UUIDResolver.start(dir,10000,9999999);
    System.out.println("String_Node_Str");
    final int MIN_FS=64 * 1024;
    final int MAX_FS=512 * 1024 * 1024;
    final int MIN_REC=4 * 1024;
    final int MAX_REC=1024 * 1024;
    InetSocketAddress mrcAddr=new InetSocketAddress(mrcURL.getHost(),mrcURL.getPort());
    List<String> grs=new ArrayList(1);
    grs.add("String_Node_Str");
    final UserCredentials uc=MRCClient.getCredentials("String_Node_Str",grs);
    if (options.get("String_Node_Str").switchValue) {
      MRCClient mrcClient=new MRCClient(rpcClient,mrcAddr);
      StripingPolicy sp=new StripingPolicy(StripingPolicyType.STRIPING_POLICY_RAID0,128,1);
      RPCResponse r=mrcClient.mkvol(mrcAddr,uc,volname,OSDSelectionPolicyType.OSD_SELECTION_POLICY_SIMPLE.intValue(),sp,AccessControlPolicyType.ACCESS_CONTROL_POLICY_POSIX.intValue(),0775);
      r.get();
      r.freeBuffers();
    }
    RandomAccessFile tmp=new RandomAccessFile("String_Node_Str",mrcAddr,volname + path + "String_Node_Str",rpcClient,"String_Node_Str",grs);
    System.out.println("String_Node_Str" + tmp.getStripingPolicyAsString());
    for (int fsize=MIN_FS; fsize <= MAX_FS; fsize=fsize * 2) {
      for (int recsize=MIN_REC; recsize <= MAX_REC; recsize=recsize * 2) {
        final int numRecs=fsize / recsize;
        if (numRecs == 0)         continue;
        byte[] sendBuffer=new byte[recsize];
        for (int i=0; i < recsize; i++) {
          sendBuffer[i]=(byte)((i % 26) + 65);
        }
        long tStart=System.currentTimeMillis();
        RandomAccessFile raf=new RandomAccessFile("String_Node_Str",mrcAddr,volname + path,rpcClient,"String_Node_Str",grs);
        long tOpen=System.currentTimeMillis();
        long bytesWritten=0;
        for (int rec=0; rec < numRecs; rec++) {
          bytesWritten+=raf.write(sendBuffer,0,recsize);
        }
        final long tWrite=System.currentTimeMillis();
        assert(bytesWritten == numRecs * recsize);
        raf.flush();
        raf.seek(0);
        final long tFlush=System.currentTimeMillis();
        byte[] readBuffer=new byte[recsize];
        for (int rec=0; rec < numRecs; rec++) {
          final int bytesRead=raf.read(readBuffer,0,recsize);
          if (bytesRead != recsize) {
            System.out.println("String_Node_Str" + rec * recsize);
            System.out.println("String_Node_Str" + recsize + "String_Node_Str");
            System.out.println("String_Node_Str" + bytesRead + "String_Node_Str");
            System.exit(1);
          }
          for (int i=0; i < recsize; i++) {
            if (readBuffer[i] != (byte)((i % 26) + 65)) {
              System.out.println("String_Node_Str" + (rec * recsize + i));
              System.out.println("String_Node_Str" + (byte)((i % 26) + 65));
              System.out.println("String_Node_Str" + readBuffer[i]);
              System.exit(1);
            }
          }
        }
        final long tRead=System.currentTimeMillis();
        raf.delete();
        final long tDelete=System.currentTimeMillis();
        double writeRate=((double)fsize) / 1024.0 / (((double)(tWrite - tOpen + 1)) / 1000.0);
        double readRate=((double)fsize) / 1024.0 / (((double)(tRead - tFlush + 1)) / 1000.0);
        System.out.format("String_Node_Str",fsize / 1024,recsize,(tWrite - tOpen),writeRate,(tRead - tFlush),readRate);
      }
    }
    System.out.println("String_Node_Str");
    rpcClient.shutdown();
    UUIDResolver.shutdown();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    System.exit(1);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    Map<String,CliOption> options=new HashMap<String,CliOption>();
    List<String> arguments=new ArrayList<String>(2);
    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.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);
    Logging.start(Logging.LEVEL_WARN);
    TimeSync.initialize(null,10000,50);
    if (arguments.size() != 2) {
      usage();
      return;
    }
    final ONCRPCServiceURL mrcURL=new ONCRPCServiceURL(arguments.get(1));
    final String path=(options.get("String_Node_Str").stringValue != null) ? options.get("String_Node_Str").stringValue : "String_Node_Str";
    final String volname=(options.get("String_Node_Str").stringValue != null) ? options.get("String_Node_Str").stringValue : "String_Node_Str";
    final ONCRPCServiceURL dirURL=new ONCRPCServiceURL(arguments.get(0));
    boolean useSSL=false;
    final SSLOptions sslOptions;
    if (dirURL.getProtocol().equalsIgnoreCase("String_Node_Str")) {
      String serviceCredsFile=null;
      String serviceCredsPass=null;
      String trustedCAsFile=null;
      String trustedCAsPass=null;
      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;
      sslOptions=new SSLOptions(new FileInputStream(serviceCredsFile),serviceCredsPass,SSLOptions.PKCS12_CONTAINER,new FileInputStream(trustedCAsFile),trustedCAsPass,SSLOptions.JKS_CONTAINER,false);
      System.out.println("String_Node_Str");
    }
 else {
      sslOptions=null;
    }
    RPCNIOSocketClient rpcClient=new RPCNIOSocketClient(sslOptions,10000,5 * 60 * 1000);
    rpcClient.start();
    rpcClient.waitForStartup();
    DIRClient dir=new DIRClient(rpcClient,new InetSocketAddress(dirURL.getHost(),dirURL.getPort()));
    UUIDResolver.start(dir,10000,9999999);
    System.out.println("String_Node_Str");
    final int MIN_FS=64 * 1024;
    final int MAX_FS=512 * 1024 * 1024;
    final int MIN_REC=4 * 1024;
    final int MAX_REC=1024 * 1024;
    InetSocketAddress mrcAddr=new InetSocketAddress(mrcURL.getHost(),mrcURL.getPort());
    List<String> grs=new ArrayList(1);
    grs.add("String_Node_Str");
    final UserCredentials uc=MRCClient.getCredentials("String_Node_Str",grs);
    if (options.get("String_Node_Str").switchValue) {
      MRCClient mrcClient=new MRCClient(rpcClient,mrcAddr);
      StripingPolicy sp=new StripingPolicy(StripingPolicyType.STRIPING_POLICY_RAID0,128,1);
      RPCResponse r=mrcClient.mkvol(mrcAddr,uc,volname,OSDSelectionPolicyType.OSD_SELECTION_POLICY_SIMPLE.intValue(),sp,AccessControlPolicyType.ACCESS_CONTROL_POLICY_POSIX.intValue(),0775);
      r.get();
      r.freeBuffers();
    }
    RandomAccessFile tmp=new RandomAccessFile("String_Node_Str",mrcAddr,volname + path + "String_Node_Str",rpcClient,"String_Node_Str",grs);
    System.out.println("String_Node_Str" + tmp.getStripingPolicyAsString());
    for (int fsize=MIN_FS; fsize <= MAX_FS; fsize=fsize * 2) {
      for (int recsize=MIN_REC; recsize <= MAX_REC; recsize=recsize * 2) {
        if (testSequential(fsize,recsize,mrcAddr,volname,path,rpcClient,grs)) {
          continue;
        }
        if (testRandom(fsize,recsize,mrcAddr,volname,path,rpcClient,grs)) {
          continue;
        }
      }
    }
    System.out.println("String_Node_Str");
    rpcClient.shutdown();
    UUIDResolver.shutdown();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    System.exit(1);
  }
}