Program: 113438
Project: 113438
Buggy source:
public static void main(String[] args){
  if (args.length < 1 || !args[0].equals("String_Node_Str")) {
    System.out.println("String_Node_Str");
    System.exit(1);
  }
  Logging.start(Logging.LEVEL_ERROR,Category.tool);
  userCredentials=UserCredentials.newBuilder().setUsername("String_Node_Str").addGroups("String_Node_Str").build();
  String dirAddress="String_Node_Str";
  SSLOptions sslOptions=null;
  Options options=new Options();
  try {
    client=ClientFactory.createClient(dirAddress,userCredentials,sslOptions,options);
    client.start();
    volume=client.openVolume("String_Node_Str",sslOptions,options);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
    System.exit(2);
  }
  String exampleFilesDir="String_Node_Str";
  java.io.File dir=new java.io.File(exampleFilesDir);
  String[] files=dir.list();
  exampleFiles=new ArrayList<String>(files.length);
  if (files != null) {
    for (    String file : files) {
      exampleFiles.add(exampleFilesDir + file);
    }
  }
  boolean errorsOccurred=DeleteDirectoryRecursively("String_Node_Str");
  for (  String filename : exampleFiles) {
    java.io.File sourceFile=new java.io.File(filename);
    FileInputStream source=null;
    FileHandle target=null;
    try {
      source=new FileInputStream(sourceFile);
      target=volume.openFile(userCredentials,"String_Node_Str" + sourceFile.getName(),SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_RDWR.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_CREAT.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_TRUNC.getNumber());
      byte[] buffer=new byte[128 * 1024];
      int bytesRead;
      while ((bytesRead=source.read(buffer)) != -1) {
        target.write(userCredentials,buffer,bytesRead,0);
      }
    }
 catch (    FileNotFoundException e) {
      System.out.println("String_Node_Str" + filename + "String_Node_Str");
      e.printStackTrace();
      errorsOccurred=true;
    }
catch (    IOException e) {
      System.out.println("String_Node_Str" + filename + "String_Node_Str");
      e.printStackTrace();
      errorsOccurred=true;
    }
 finally {
      if (source != null) {
        try {
          source.close();
        }
 catch (        IOException e) {
          System.out.println("String_Node_Str" + filename + "String_Node_Str");
          e.printStackTrace();
          errorsOccurred=true;
        }
      }
      if (target != null) {
        try {
          target.close();
        }
 catch (        IOException e) {
          System.out.println("String_Node_Str" + sourceFile.getName() + "String_Node_Str");
          e.printStackTrace();
          errorsOccurred=true;
        }
      }
    }
  }
  for (  String file : exampleFiles) {
    String fileName=new java.io.File(file).getName();
    long fileSize=new java.io.File(file).length();
    FileHandle xtreemfsFile=null;
    try {
      xtreemfsFile=volume.openFile(userCredentials,"String_Node_Str" + fileName,SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_RDWR.getNumber());
      Stat stbuf=xtreemfsFile.getAttr(userCredentials).toBuilder().setMode(0666).build();
      volume.setAttr(userCredentials,"String_Node_Str" + fileName,stbuf,Setattrs.SETATTR_MODE.getNumber());
      xtreemfsFile.truncate(userCredentials,fileSize);
      xtreemfsFile.close();
    }
 catch (    IOException e) {
      System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ fileSize+ "String_Node_Str");
      e.printStackTrace();
      errorsOccurred=true;
    }
  }
  client.shutdown();
  if (errorsOccurred) {
    System.out.println("String_Node_Str");
    System.exit(3);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  if (args.length < 1 || !args[0].equals("String_Node_Str")) {
    System.out.println("String_Node_Str");
    System.exit(1);
  }
  Logging.start(Logging.LEVEL_ERROR,Category.tool);
  userCredentials=UserCredentials.newBuilder().setUsername("String_Node_Str").addGroups("String_Node_Str").build();
  String dirAddress="String_Node_Str";
  SSLOptions sslOptions=null;
  Options options=new Options();
  try {
    client=ClientFactory.createClient(dirAddress,userCredentials,sslOptions,options);
    client.start();
    volume=client.openVolume("String_Node_Str",sslOptions,options);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
    System.exit(2);
  }
  String exampleFilesDir="String_Node_Str";
  java.io.File dir=new java.io.File(exampleFilesDir);
  String[] files=dir.list();
  exampleFiles=new ArrayList<String>(files.length);
  if (files != null) {
    for (    String file : files) {
      exampleFiles.add(exampleFilesDir + file);
    }
  }
  boolean errorsOccurred=DeleteDirectoryRecursively("String_Node_Str");
  for (  String filename : exampleFiles) {
    java.io.File sourceFile=new java.io.File(filename);
    FileInputStream source=null;
    FileHandle target=null;
    try {
      source=new FileInputStream(sourceFile);
      target=volume.openFile(userCredentials,"String_Node_Str" + sourceFile.getName(),SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_RDWR.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_CREAT.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_TRUNC.getNumber());
      byte[] buffer=new byte[128 * 1024];
      int bytesRead=0;
      long bytewritten=0;
      while ((bytesRead=source.read(buffer)) != -1) {
        target.write(userCredentials,buffer,bytesRead,bytewritten);
        bytewritten+=bytesRead;
      }
    }
 catch (    FileNotFoundException e) {
      System.out.println("String_Node_Str" + filename + "String_Node_Str");
      e.printStackTrace();
      errorsOccurred=true;
    }
catch (    IOException e) {
      System.out.println("String_Node_Str" + filename + "String_Node_Str");
      e.printStackTrace();
      errorsOccurred=true;
    }
 finally {
      if (source != null) {
        try {
          source.close();
        }
 catch (        IOException e) {
          System.out.println("String_Node_Str" + filename + "String_Node_Str");
          e.printStackTrace();
          errorsOccurred=true;
        }
      }
      if (target != null) {
        try {
          target.close();
        }
 catch (        IOException e) {
          System.out.println("String_Node_Str" + sourceFile.getName() + "String_Node_Str");
          e.printStackTrace();
          errorsOccurred=true;
        }
      }
    }
  }
  for (  String file : exampleFiles) {
    String fileName=new java.io.File(file).getName();
    long fileSize=new java.io.File(file).length();
    FileHandle xtreemfsFile=null;
    try {
      xtreemfsFile=volume.openFile(userCredentials,"String_Node_Str" + fileName,SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_RDWR.getNumber());
      Stat stbuf=xtreemfsFile.getAttr(userCredentials).toBuilder().setMode(0666).build();
      volume.setAttr(userCredentials,"String_Node_Str" + fileName,stbuf,Setattrs.SETATTR_MODE.getNumber());
      xtreemfsFile.truncate(userCredentials,fileSize);
      xtreemfsFile.close();
    }
 catch (    IOException e) {
      System.out.println("String_Node_Str" + fileName + "String_Node_Str"+ fileSize+ "String_Node_Str");
      e.printStackTrace();
      errorsOccurred=true;
    }
  }
  client.shutdown();
  if (errorsOccurred) {
    System.out.println("String_Node_Str");
    System.exit(3);
  }
}