Program: 113509
Project: 113509
Buggy source:
public static void main(String[] args){
  try {
    CLOptionParser parser=new CLOptionParser("String_Node_Str");
    CLOption.StringValue optVolname=(StringValue)parser.addOption(new CLOption.StringValue("String_Node_Str","String_Node_Str","String_Node_Str"));
    CLOption.StringValue optPath=(StringValue)parser.addOption(new CLOption.StringValue("String_Node_Str","String_Node_Str","String_Node_Str"));
    CLOption.StringValue optPKCS12file=(CLOption.StringValue)parser.addOption(new CLOption.StringValue(null,"String_Node_Str","String_Node_Str"));
    CLOption.StringValue optPKCS12passphrase=(CLOption.StringValue)parser.addOption(new CLOption.StringValue(null,"String_Node_Str","String_Node_Str"));
    CLOption.Switch optRandomOnly=(Switch)parser.addOption(new CLOption.Switch("String_Node_Str","String_Node_Str","String_Node_Str"));
    CLOption.IntegerValue optReplicas=(IntegerValue)parser.addOption(new CLOption.IntegerValue("String_Node_Str","String_Node_Str","String_Node_Str"));
    CLOption.Switch optTrunc=(Switch)parser.addOption(new CLOption.Switch("String_Node_Str","String_Node_Str","String_Node_Str"));
    CLOption.Switch optAddR=(Switch)parser.addOption(new CLOption.Switch("String_Node_Str","String_Node_Str","String_Node_Str"));
    parser.parse(args);
    final List<String> arguments=parser.getArguments();
    Logging.start(Logging.LEVEL_WARN);
    TimeSync.initializeLocal(10000,50);
    if (arguments.size() != 1) {
      usage();
      return;
    }
    final String path=optPath.isSet() ? optPath.getValue() : "String_Node_Str";
    final String volname=optVolname.isSet() ? optVolname.getValue() : "String_Node_Str";
    final ONCRPCServiceURL dirURL=new ONCRPCServiceURL(arguments.get(0),XDRUtils.ONCRPC_SCHEME,DIRInterface.ONC_RPC_PORT_DEFAULT);
    final boolean useSSL=dirURL.getProtocol().equals(XDRUtils.ONCRPCG_SCHEME) || dirURL.getProtocol().equals(XDRUtils.ONCRPCS_SCHEME);
    final boolean randomOnly=optRandomOnly.isSet();
    final boolean addReplica=optAddR.isSet();
    final int replicas=optReplicas.isSet() ? optReplicas.getValue() : 1;
    SSLOptions sslOptions=null;
    if (useSSL) {
      if (!optPKCS12file.isSet())       throw new InvalidUsageException("String_Node_Str" + optPKCS12file.getName());
      if (!optPKCS12passphrase.isSet())       throw new InvalidUsageException("String_Node_Str" + optPKCS12passphrase.getName());
      final boolean gridSSL=dirURL.getProtocol().equals(XDRUtils.ONCRPCG_SCHEME);
      sslOptions=new SSLOptions(new FileInputStream(optPKCS12file.getValue()),optPKCS12passphrase.getValue(),"String_Node_Str",null,null,"String_Node_Str",false,gridSSL);
    }
    Client c=new Client(new InetSocketAddress[]{new InetSocketAddress(dirURL.getHost(),dirURL.getPort())},30 * 1000,5 * 60 * 1000,sslOptions);
    c.start();
    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;
    List<String> grs=new ArrayList(1);
    grs.add("String_Node_Str");
    final UserCredentials uc=MRCClient.getCredentials("String_Node_Str",grs);
    try {
      StripingPolicy sp=new StripingPolicy(StripingPolicyType.STRIPING_POLICY_RAID0,128,1);
      c.createVolume(volname,uc,sp,AccessControlPolicyType.ACCESS_CONTROL_POLICY_POSIX.intValue(),0777);
    }
 catch (    Exception ex) {
    }
    Volume v=c.getVolume(volname,uc);
    if (replicas > 1) {
      File f=v.getFile("String_Node_Str");
      f.setDefaultReplication(Constants.REPL_UPDATE_PC_WARONE,replicas);
    }
    RandomAccessFile tmp=v.getFile(path + "String_Node_Str").open("String_Node_Str",0666);
    if (!randomOnly) {
      for (int fsize=MIN_FS; fsize <= MAX_FS; fsize=fsize * 2) {
        for (int recsize=MIN_REC; recsize <= MAX_REC; recsize=recsize * 2) {
          if (testSequential_write(fsize,recsize,path,v)) {
            continue;
          }
        }
      }
      System.out.println("String_Node_Str");
      Thread.sleep(100 * 1000);
      int readRepl=replicas - 1;
      if (addReplica) {
        for (int fsize=MIN_FS; fsize <= MAX_FS; fsize=fsize * 2) {
          for (int recsize=MIN_REC; recsize <= MAX_REC; recsize=recsize * 2) {
            File f=v.getFile(path + "String_Node_Str" + fsize+ "String_Node_Str"+ recsize);
            f.addReplica(1,f.getSuitableOSDs(1),0);
          }
        }
        readRepl=replicas;
      }
      for (int fsize=MIN_FS; fsize <= MAX_FS; fsize=fsize * 2) {
        for (int recsize=MIN_REC; recsize <= MAX_REC; recsize=recsize * 2) {
          if (testSequential_read(fsize,recsize,path,v,readRepl)) {
            continue;
          }
        }
      }
    }
    System.out.println("String_Node_Str");
    c.stop();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    System.exit(1);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    CLOptionParser parser=new CLOptionParser("String_Node_Str");
    CLOption.StringValue optVolname=(StringValue)parser.addOption(new CLOption.StringValue("String_Node_Str","String_Node_Str","String_Node_Str"));
    CLOption.StringValue optPath=(StringValue)parser.addOption(new CLOption.StringValue("String_Node_Str","String_Node_Str","String_Node_Str"));
    CLOption.StringValue optPKCS12file=(CLOption.StringValue)parser.addOption(new CLOption.StringValue(null,"String_Node_Str","String_Node_Str"));
    CLOption.StringValue optPKCS12passphrase=(CLOption.StringValue)parser.addOption(new CLOption.StringValue(null,"String_Node_Str","String_Node_Str"));
    CLOption.Switch optRandomOnly=(Switch)parser.addOption(new CLOption.Switch("String_Node_Str","String_Node_Str","String_Node_Str"));
    CLOption.IntegerValue optReplicas=(IntegerValue)parser.addOption(new CLOption.IntegerValue("String_Node_Str","String_Node_Str","String_Node_Str"));
    CLOption.Switch optTrunc=(Switch)parser.addOption(new CLOption.Switch("String_Node_Str","String_Node_Str","String_Node_Str"));
    CLOption.Switch optAddR=(Switch)parser.addOption(new CLOption.Switch("String_Node_Str","String_Node_Str","String_Node_Str"));
    parser.parse(args);
    final List<String> arguments=parser.getArguments();
    Logging.start(Logging.LEVEL_WARN);
    TimeSync.initializeLocal(10000,50);
    if (arguments.size() != 1) {
      usage();
      return;
    }
    final String path=optPath.isSet() ? optPath.getValue() : "String_Node_Str";
    final String volname=optVolname.isSet() ? optVolname.getValue() : "String_Node_Str";
    final ONCRPCServiceURL dirURL=new ONCRPCServiceURL(arguments.get(0),XDRUtils.ONCRPC_SCHEME,DIRInterface.ONC_RPC_PORT_DEFAULT);
    final boolean useSSL=dirURL.getProtocol().equals(XDRUtils.ONCRPCG_SCHEME) || dirURL.getProtocol().equals(XDRUtils.ONCRPCS_SCHEME);
    final boolean randomOnly=optRandomOnly.isSet();
    final boolean addReplica=optAddR.isSet();
    final int replicas=optReplicas.isSet() ? optReplicas.getValue() : 1;
    SSLOptions sslOptions=null;
    if (useSSL) {
      if (!optPKCS12file.isSet())       throw new InvalidUsageException("String_Node_Str" + optPKCS12file.getName());
      if (!optPKCS12passphrase.isSet())       throw new InvalidUsageException("String_Node_Str" + optPKCS12passphrase.getName());
      final boolean gridSSL=dirURL.getProtocol().equals(XDRUtils.ONCRPCG_SCHEME);
      sslOptions=new SSLOptions(new FileInputStream(optPKCS12file.getValue()),optPKCS12passphrase.getValue(),"String_Node_Str",null,null,"String_Node_Str",false,gridSSL);
    }
    Client c=new Client(new InetSocketAddress[]{new InetSocketAddress(dirURL.getHost(),dirURL.getPort())},30 * 1000,5 * 60 * 1000,sslOptions);
    c.start();
    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;
    List<String> grs=new ArrayList(1);
    grs.add("String_Node_Str");
    final UserCredentials uc=MRCClient.getCredentials("String_Node_Str",grs);
    try {
      StripingPolicy sp=new StripingPolicy(StripingPolicyType.STRIPING_POLICY_RAID0,128,1);
      c.createVolume(volname,uc,sp,AccessControlPolicyType.ACCESS_CONTROL_POLICY_POSIX.intValue(),0777);
    }
 catch (    Exception ex) {
    }
    Volume v=c.getVolume(volname,uc);
    if (replicas > 1) {
      File f=v.getFile("String_Node_Str");
      f.setDefaultReplication(Constants.REPL_UPDATE_PC_WARONE,replicas);
    }
    RandomAccessFile tmp=v.getFile(path + "String_Node_Str").open("String_Node_Str",0666);
    if (!randomOnly) {
      for (int fsize=MIN_FS; fsize <= MAX_FS; fsize=fsize * 2) {
        for (int recsize=MIN_REC; recsize <= MAX_REC; recsize=recsize * 2) {
          if (testSequential_write(fsize,recsize,path,v)) {
            continue;
          }
        }
      }
      System.out.println("String_Node_Str");
      Thread.sleep(100 * 1000);
      int readRepl=replicas - 1;
      if (addReplica) {
        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) {
              break;
            }
            File f=v.getFile(path + "String_Node_Str" + fsize+ "String_Node_Str"+ recsize);
            f.addReplica(1,f.getSuitableOSDs(1),0);
          }
        }
        readRepl=replicas;
      }
      for (int fsize=MIN_FS; fsize <= MAX_FS; fsize=fsize * 2) {
        for (int recsize=MIN_REC; recsize <= MAX_REC; recsize=recsize * 2) {
          if (testSequential_read(fsize,recsize,path,v,readRepl)) {
            continue;
          }
        }
      }
    }
    System.out.println("String_Node_Str");
    c.stop();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    System.exit(1);
  }
}