[Demonstration 1]

[Buggy Method]
public String copyTemplate(Service service) throws IOException {
    URL scriptFile = ClassLoader.getSystemResource("chef/tomcat-service-deploy-recipe-template");
    URL destURL = ClassLoader.getSystemResource("chef");
    File srcFolder = new File(scriptFile.getFile());
    File destFolder = new File(destURL.getFile().concat("/service" + service.getId()));
    FileUtils.copyDirectory(srcFolder, destFolder);
    return destFolder.getAbsolutePath();
}

[Buggy Hunk]
URL destURL = ClassLoader.getSystemResource("chef");

[Patch]
URL destURL = RecipeDeployer.destURL;

[Demonstration 2]

[Buggy Method]
public RawFile get(String projectName, String url, String newPath, Repository repository) throws IOException {
    String path = persistentStore.getPathForURLInProject(projectName, url);
    byte[] contents;
    if (path == null) {
        path = newPath;
        contents = fetch(projectName, url, path);
    } else {
        Util.sout("Found (" + projectName + "): " + url);
        Util.sout("At (" + projectName + "): " + path);
        contents = new RepositoryObjectTreeWalker(repository).getDirectoryContents().getFileTable().get(path).getContents();
    }
    return new RepositoryFile(path, contents);
}

[Buggy Hunk]
return new RepositoryFile(path, contents);

[Patch]
return new RepositoryFile(newPath, contents);

[Demonstration 3]

[Buggy Method]
protected void readCSV(String Inputfile) {
    System.out.println("Reading: " + Inputfile);
    ArrayList<String> content = new ArrayList<String>();
    try {
        content = readFile(Inputfile);
    } catch (Exception e) {
        e.printStackTrace();
    }
    //Starts at 1 so that the first row is ignored
    for (int i = 1; i < content.size(); i++) {
        try {
            //dimension;unit;m;k;s;kel;mol;amp;cand;offset;gradient
            String test = content.get(i);
            int count = test.length() - test.replace(";", "").length();
            String[] parts = content.get(i).split(";");
            if ((count + 1) != 11) {
                System.out.println("Error in line: " + (i + 1));
                System.out.println("count: " + (count + 1));
                System.out.println("----");
            }
            RawUnits tempRawUnits = new RawUnits(parts[0], parts[1], Integer.parseInt(parts[2]), Integer.parseInt(parts[3]), Integer.parseInt(parts[4]), Integer.parseInt(parts[5]), Integer.parseInt(parts[6]), Integer.parseInt(parts[7]), Integer.parseInt(parts[8]), Double.parseDouble(parts[9].replace(",", ".")), Double.parseDouble(parts[10].replace(",", ".")));
            Util.getInstance().unitsArray.add(tempRawUnits);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    System.out.println("Done reading: " + Inputfile);
}

[Buggy Hunk]
Util.getInstance().unitsArray.add(tempRawUnits);

[Patch]
unitsArray.add(tempRawUnits);