Program: 113404
Project: 113404
Buggy source:
/** 
 * @param args args[0] = URL to existing volume e.g., pbrpcs://localhost/regular
 * @return
 * @throws Exception
 */
public static void main(String[] args){
  if (args.length < 1) {
    System.out.println("String_Node_Str");
    return;
  }
  Client client=null;
  FileHandle fileHandle=null;
  try {
    int lastSlashIndex=args[0].lastIndexOf('/');
    final ONCRPCServiceURL url=new ONCRPCServiceURL(args[0].substring(0,lastSlashIndex),Schemes.SCHEME_PBRPC,PORTS.DIR_PBRPC_PORT_DEFAULT.getNumber());
    final String volumeName=args[0].substring(lastSlashIndex + 1);
    final Options options=new Options();
    final UserCredentials userCredentials=UserCredentials.newBuilder().setUsername(System.getProperty("String_Node_Str")).addGroups("String_Node_Str").build();
    final SSLOptions sslOptions=!url.getProtocol().equals(Schemes.SCHEME_PBRPC) ? SetupUtils.createClientSSLOptions() : null;
    Logging.start(Logging.LEVEL_WARN);
    client=ClientFactory.createClient(url.getHost() + "String_Node_Str" + url.getPort(),userCredentials,sslOptions,options);
    client.start();
    Volume volume=client.openVolume(volumeName,sslOptions,options);
    fileHandle=volume.openFile(userCredentials,"String_Node_Str" + String.format("String_Node_Str",(int)(Math.random() * 1000)) + "String_Node_Str",SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_CREAT.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_EXCL.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_RDWR.getNumber(),0644);
    byte[] data=new byte[1 << 17];
    Arrays.fill(data,(byte)0xAB);
    for (int offset=0; offset < (1 << 20); offset+=data.length) {
      fileHandle.write(userCredentials,data,data.length,offset);
    }
    byte[] readData=new byte[data.length];
    for (int offset=0; offset < (1 << 20); offset+=data.length) {
      int readCount=fileHandle.read(userCredentials,readData,data.length,offset);
      if (readCount != data.length) {
        throw new IOException("String_Node_Str" + readCount + "String_Node_Str"+ data.length);
      }
      if (!Arrays.equals(readData,data)) {
        throw new IOException("String_Node_Str" + offset);
      }
    }
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage() + "String_Node_Str"+ e.getStackTrace());
    return;
  }
 finally {
    if (fileHandle != null) {
      try {
        fileHandle.close();
      }
 catch (      IOException e) {
        System.err.println("String_Node_Str" + e.getMessage() + "String_Node_Str"+ e.getStackTrace());
        return;
      }
    }
    if (client != null) {
      client.shutdown();
    }
    System.out.println("String_Node_Str");
  }
  return;
}

Fixed version (ground truth):
/** 
 * @param args args[0] = URL to existing volume e.g., pbrpcs://localhost/regular
 * @return
 * @throws Exception
 */
public static void main(String[] args){
  if (args.length < 1) {
    System.out.println("String_Node_Str");
    return;
  }
  Client client=null;
  FileHandle fileHandle=null;
  try {
    int lastSlashIndex=args[0].lastIndexOf('/');
    final ONCRPCServiceURL url=new ONCRPCServiceURL(args[0].substring(0,lastSlashIndex),Schemes.SCHEME_PBRPC,PORTS.DIR_PBRPC_PORT_DEFAULT.getNumber());
    final String volumeName=args[0].substring(lastSlashIndex + 1);
    final Options options=new Options();
    final UserCredentials userCredentials=UserCredentials.newBuilder().setUsername(System.getProperty("String_Node_Str")).addGroups("String_Node_Str").build();
    final SSLOptions sslOptions=url.getProtocol().equals(Schemes.SCHEME_PBRPC) ? null : new SSLOptions(new FileInputStream(CERT_DIR + "String_Node_Str"),"String_Node_Str",SSLOptions.PKCS12_CONTAINER,new FileInputStream(CERT_DIR + "String_Node_Str"),"String_Node_Str",SSLOptions.JKS_CONTAINER,false,false,null);
    Logging.start(Logging.LEVEL_WARN);
    client=ClientFactory.createClient(url.getHost() + "String_Node_Str" + url.getPort(),userCredentials,sslOptions,options);
    client.start();
    Volume volume=client.openVolume(volumeName,sslOptions,options);
    fileHandle=volume.openFile(userCredentials,"String_Node_Str" + String.format("String_Node_Str",(int)(Math.random() * 1000)) + "String_Node_Str",SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_CREAT.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_EXCL.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_RDWR.getNumber(),0644);
    byte[] data=new byte[1 << 17];
    Arrays.fill(data,(byte)0xAB);
    for (int offset=0; offset < (1 << 20); offset+=data.length) {
      fileHandle.write(userCredentials,data,data.length,offset);
    }
    byte[] readData=new byte[data.length];
    for (int offset=0; offset < (1 << 20); offset+=data.length) {
      int readCount=fileHandle.read(userCredentials,readData,data.length,offset);
      if (readCount != data.length) {
        throw new IOException("String_Node_Str" + readCount + "String_Node_Str"+ data.length);
      }
      if (!Arrays.equals(readData,data)) {
        throw new IOException("String_Node_Str" + offset);
      }
    }
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage() + "String_Node_Str"+ e.getStackTrace());
    return;
  }
 finally {
    if (fileHandle != null) {
      try {
        fileHandle.close();
      }
 catch (      IOException e) {
        System.err.println("String_Node_Str" + e.getMessage() + "String_Node_Str"+ e.getStackTrace());
        return;
      }
    }
    if (client != null) {
      client.shutdown();
    }
    System.out.println("String_Node_Str");
  }
  return;
}