Program: 166558
Project: 166558
Buggy source:
/** 
 * Create a specific hierarchy Modify files Check if file is in history.
 */
@Test public void test2() throws IOException, ParseException, CloudsyncException, FileIOException, UsageException, InfoException {
  File rootFolder=Files.createTempDirectory("String_Node_Str").toFile();
  File targetLocalRemoteFolder=Files.createTempDirectory("String_Node_Str").toFile();
  File restoreFolder=new File(rootFolder.getParent(),rootFolder.getName() + "String_Node_Str");
  File configFile=Files.createTempFile("String_Node_Str","String_Node_Str").toFile();
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + rootFolder.getAbsolutePath());
  System.out.println("String_Node_Str" + targetLocalRemoteFolder.getAbsolutePath());
  String config="String_Node_Str";
  config+="String_Node_Str" + "String_Node_Str";
  config+="String_Node_Str" + "String_Node_Str" + targetLocalRemoteFolder.getAbsolutePath();
  config+="String_Node_Str" + "String_Node_Str" + targetLocalRemoteFolder.getAbsolutePath() + File.separator+ "String_Node_Str";
  config+="String_Node_Str" + "String_Node_Str" + targetLocalRemoteFolder.getAbsolutePath() + File.separator+ "String_Node_Str";
  config+="String_Node_Str" + "String_Node_Str";
  Files.write(configFile.toPath(),config.getBytes(),StandardOpenOption.CREATE);
  File file1=new File(rootFolder,"String_Node_Str");
  File subfolder1=new File(rootFolder,"String_Node_Str");
  File file2=new File(subfolder1,"String_Node_Str");
  File subfolder2=new File(subfolder1,"String_Node_Str");
  File file3=new File(subfolder2,"String_Node_Str");
  subfolder1.mkdirs();
  subfolder2.mkdirs();
  Files.write(file1.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.CREATE_NEW);
  Files.write(file2.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.CREATE_NEW);
  Files.write(file3.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.CREATE_NEW);
  String[] args=new String[]{"String_Node_Str","String_Node_Str",rootFolder.getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str",configFile.getAbsolutePath()};
  Cloudsync.main(args);
  Files.write(file1.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.TRUNCATE_EXISTING);
  Files.write(file2.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.TRUNCATE_EXISTING);
  Files.write(file3.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.TRUNCATE_EXISTING);
  Cloudsync.main(args);
  SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
  File historyFolder=new File(targetLocalRemoteFolder,"String_Node_Str" + "String_Node_Str" + sdf.format(new Date()));
  CmdOptions cmdOptions=new CmdOptions(args);
  cmdOptions.parse();
  Crypt crypt=new Crypt(cmdOptions);
  assertEquals(historyFolder.listFiles().length,3);
  for (  File f1 : historyFolder.listFiles()) {
    if (f1.getName().endsWith("String_Node_Str")) {
    }
 else     if (f1.isFile()) {
      assertEquals(crypt.decryptText(f1.getName()),"String_Node_Str");
      _assertEncryptedFileContentEquals(f1,crypt,"String_Node_Str");
    }
 else {
      assertEquals(crypt.decryptText(f1.getName()),"String_Node_Str");
      assertEquals(f1.listFiles().length,3);
      for (      File f2 : f1.listFiles()) {
        if (f2.getName().endsWith("String_Node_Str")) {
        }
 else         if (f2.isFile()) {
          assertEquals(crypt.decryptText(f2.getName()),"String_Node_Str");
          _assertEncryptedFileContentEquals(f2,crypt,"String_Node_Str");
        }
 else {
          assertEquals(f2.listFiles().length,2);
          assertEquals(crypt.decryptText(f2.getName()),"String_Node_Str");
          for (          File f3 : f2.listFiles()) {
            if (f3.getName().endsWith("String_Node_Str")) {
            }
 else {
              assertEquals(crypt.decryptText(f3.getName()),"String_Node_Str");
              _assertEncryptedFileContentEquals(f3,crypt,"String_Node_Str");
            }
          }
        }
      }
    }
  }
  restoreFolder.mkdir();
  args=new String[]{"String_Node_Str","String_Node_Str",restoreFolder.getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str",configFile.getAbsolutePath()};
  Cloudsync.main(args);
  assertTrue(hierarchieEquals(rootFolder,restoreFolder));
  FileUtils.deleteDirectory(rootFolder);
}

Fixed version (ground truth):
/** 
 * Create a specific hierarchy Modify files Check if file is in history.
 */
@Test public void test2() throws IOException, ParseException, CloudsyncException, FileIOException, UsageException, InfoException {
  File rootFolder=Files.createTempDirectory("String_Node_Str").toFile();
  File targetLocalRemoteFolder=Files.createTempDirectory("String_Node_Str").toFile();
  File restoreFolder=new File(rootFolder.getParent(),rootFolder.getName() + "String_Node_Str");
  File configFile=Files.createTempFile("String_Node_Str","String_Node_Str").toFile();
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + rootFolder.getAbsolutePath());
  System.out.println("String_Node_Str" + targetLocalRemoteFolder.getAbsolutePath());
  String targetLocalRemoteFolderPath=FilesystemHelper.fixPathSeparators(targetLocalRemoteFolder.getAbsolutePath());
  String config="String_Node_Str";
  config+="String_Node_Str" + "String_Node_Str";
  config+="String_Node_Str" + "String_Node_Str" + targetLocalRemoteFolderPath;
  config+="String_Node_Str" + "String_Node_Str" + targetLocalRemoteFolderPath + File.separator+ "String_Node_Str";
  config+="String_Node_Str" + "String_Node_Str" + targetLocalRemoteFolderPath + File.separator+ "String_Node_Str";
  config+="String_Node_Str" + "String_Node_Str";
  Files.write(configFile.toPath(),config.getBytes(),StandardOpenOption.CREATE);
  File file1=new File(rootFolder,"String_Node_Str");
  File subfolder1=new File(rootFolder,"String_Node_Str");
  File file2=new File(subfolder1,"String_Node_Str");
  File subfolder2=new File(subfolder1,"String_Node_Str");
  File file3=new File(subfolder2,"String_Node_Str");
  subfolder1.mkdirs();
  subfolder2.mkdirs();
  Files.write(file1.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.CREATE_NEW);
  Files.write(file2.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.CREATE_NEW);
  Files.write(file3.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.CREATE_NEW);
  String[] args=new String[]{"String_Node_Str","String_Node_Str",rootFolder.getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str",configFile.getAbsolutePath()};
  Cloudsync.main(args);
  Files.write(file1.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.TRUNCATE_EXISTING);
  Files.write(file2.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.TRUNCATE_EXISTING);
  Files.write(file3.toPath(),"String_Node_Str".getBytes("String_Node_Str"),StandardOpenOption.TRUNCATE_EXISTING);
  Cloudsync.main(args);
  SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
  File historyFolder=new File(targetLocalRemoteFolder,"String_Node_Str" + "String_Node_Str" + sdf.format(new Date()));
  CmdOptions cmdOptions=new CmdOptions(args);
  cmdOptions.parse();
  Crypt crypt=new Crypt(cmdOptions);
  assertEquals(historyFolder.listFiles().length,3);
  for (  File f1 : historyFolder.listFiles()) {
    if (f1.getName().endsWith("String_Node_Str")) {
    }
 else     if (f1.isFile()) {
      assertEquals(crypt.decryptText(f1.getName()),"String_Node_Str");
      _assertEncryptedFileContentEquals(f1,crypt,"String_Node_Str");
    }
 else {
      assertEquals(crypt.decryptText(f1.getName()),"String_Node_Str");
      assertEquals(f1.listFiles().length,3);
      for (      File f2 : f1.listFiles()) {
        if (f2.getName().endsWith("String_Node_Str")) {
        }
 else         if (f2.isFile()) {
          assertEquals(crypt.decryptText(f2.getName()),"String_Node_Str");
          _assertEncryptedFileContentEquals(f2,crypt,"String_Node_Str");
        }
 else {
          assertEquals(f2.listFiles().length,2);
          assertEquals(crypt.decryptText(f2.getName()),"String_Node_Str");
          for (          File f3 : f2.listFiles()) {
            if (f3.getName().endsWith("String_Node_Str")) {
            }
 else {
              assertEquals(crypt.decryptText(f3.getName()),"String_Node_Str");
              _assertEncryptedFileContentEquals(f3,crypt,"String_Node_Str");
            }
          }
        }
      }
    }
  }
  restoreFolder.mkdir();
  args=new String[]{"String_Node_Str","String_Node_Str",restoreFolder.getAbsolutePath(),"String_Node_Str","String_Node_Str","String_Node_Str",configFile.getAbsolutePath()};
  Cloudsync.main(args);
  assertTrue(hierarchieEquals(rootFolder,restoreFolder));
  FileUtils.deleteDirectory(rootFolder);
}