[Demonstration 1]

[Buggy Method]
public static boolean isCommentEnd(String curLine) {
    return curLine.startsWith(HTML_COMMENTEND) || curLine.startsWith(JSP_COMMENTEND);
}

[Buggy Hunk]
return curLine.startsWith(HTML_COMMENTEND) || curLine.startsWith(JSP_COMMENTEND);

[Patch]
return curLine.endsWith(HTML_COMMENTEND) || curLine.endsWith(JSP_COMMENTEND);

[Demonstration 2]

[Buggy Method]
public static void runBenchmark() {
    GraphGenerator gen = new GraphGenerator();
    GraphObs strct;
    Analyst al;
    boolean SOAnalist = true;
    int iter = 10000;
    String location = "benchSOResultTest4-PLSO9-23-27-2-2-2-1.csv";
    FileWriter writer = null;
    try {
        writer = new FileWriter(location, true);
    } catch (IOException ex) {
        System.err.println("Couldnt open file to write benchresults to");
        Logger.getLogger(DiagSTN.class.getName()).log(Level.SEVERE, null, ex);
    }
    long start, end;
    for (int i = 0; i < iter; i++) {
        //strct = gen.generateBAGraph(200, 3, true, 2, 1, true);
        strct = gen.generatePlanlikeGraph(9, 23, 27, 2, 2, 2, 1, true);
        if (strct.observations.size() < 1) {
            i--;
            continue;
        }
        if (!SOAnalist)
            al = new Analyst(strct.graph);
        else
            al = new SOAnalyst(strct.graph);
        for (Observation ob : strct.observations) {
            al.addObservation(ob);
        }
        start = System.nanoTime();
        al.generatePaths();
        if (!SOAnalist)
            al.propagateWeights();
        al.generateDiagnosis();
        end = System.nanoTime();
        try {
            writer.append(SOAnalist + "," + al.diagSize() + "," + (end - start) + "\n");
            if (i % 100 == 0)
                writer.flush();
        } catch (Throwable ex) {
            System.err.println("Couldnt append line to file");
            Logger.getLogger(DiagSTN.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    try {
        writer.flush();
        writer.close();
    } catch (IOException ex) {
        System.err.println("Couldnt close file to write benchresults to");
        Logger.getLogger(DiagSTN.class.getName()).log(Level.SEVERE, null, ex);
    }
}

[Buggy Hunk]
strct = gen.generatePlanlikeGraph(9, 23, 27, 2, 2, 2, 1, true);

[Patch]
strct = gen.generatePlanlikeGraph(9, 23, 27, 2, 2, 2, 5, 10, true);

[Demonstration 3]

[Buggy Method]
public int GetDeed(int pos) {
    Integer[] deeds = { 1, 3, 6, 7, 8, 11, 13, 14, 16, 18, 19, 21, 23, 24, 26, 27, 29, 31, 32, 34, 37, 39, 12, 28, 5, 15, 25, 35 };
    return Arrays.asList(deeds).indexOf(pos);
}

[Buggy Hunk]
Integer deeds[]= {1,3,6,7,8,11,13,14,16,18,19,21,23,24,26,27,29,31,32,34,37,39,12,28,5,15,25,35};

[Patch]
Integer deeds[]= {1,3,6,8,9,11,13,14,16,18,19,21,23,24,26,27,29,31,32,34,37,39,12,28,5,15,25,35};