[Demonstration 1]

[Buggy Method]
private void write(final CChangelog c) {
    if (c == null) {
        throw new NullPointerException("Changelog");
    }
    this.sink.head();
    this.sink.title();
    this.sink.text("Changes");
    this.sink.title_();
    this.sink.head_();
    this.sink.body();
    this.sink.section1();
    this.sink.sectionTitle1();
    this.sink.text("Changes");
    this.sink.sectionTitle1_();
    this.sink.paragraph();
    this.sink.text("Subscribe to the ");
    this.sink.link("releases.atom");
    this.sink.text("atom feed.");
    this.sink.link_();
    this.sink.paragraph_();
    this.sink.table();
    final Map<String, URI> ticket_systems = c.ticketSystems();
    final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
    for (final CRelease r : c.releases()) {
        this.sink.tableRow();
        this.sink.tableCell();
        this.sink.text(formatter.format(r.date()));
        this.sink.tableCell_();
        this.sink.tableCell();
        this.sink.text(String.format("Release: %s %s", c.project(), r.version()));
        this.sink.tableCell_();
        this.sink.tableRow_();
        final URI sys = ticket_systems.get(r.ticketSystemID());
        for (final CItem i : r.items()) {
            this.sink.tableRow();
            this.sink.tableCell();
            this.sink.text(formatter.format(i.date()));
            this.sink.tableCell_();
            this.sink.tableCell();
            switch(i.type()) {
                case CHANGE_TYPE_CODE_CHANGE:
                    {
                        this.sink.text("Code change: ");
                        break;
                    }
                case CHANGE_TYPE_CODE_FIX:
                    {
                        this.sink.text("Code fix: ");
                        break;
                    }
                case CHANGE_TYPE_CODE_NEW:
                    {
                        this.sink.text("Code new: ");
                        break;
                    }
            }
            this.sink.text(i.summary());
            final List<String> tickets = i.tickets();
            if (tickets.size() > 0) {
                this.sink.text(" (tickets: ");
                for (int index = 0; index < tickets.size(); ++index) {
                    final String ticket = tickets.get(index);
                    final StringBuilder ticket_uri = new StringBuilder();
                    ticket_uri.append(sys);
                    ticket_uri.append(ticket);
                    this.sink.link(ticket_uri.toString());
                    this.sink.text(ticket);
                    this.sink.link_();
                    if ((index + 1) < tickets.size()) {
                        this.sink.text(", ");
                    }
                }
                this.sink.text(")");
            }
            this.sink.tableCell_();
            this.sink.tableRow_();
        }
    }
    this.sink.table_();
    this.sink.section1_();
    this.sink.body_();
    this.sink.flush();
    this.sink.close();
}

[Buggy Hunk]
r.version()));

[Patch]
r.version().toVersionString()));

[Demonstration 2]

[Buggy Method]
public String getChartJson() {
    JSONObject jsonObject = new JSONObject();
    JSONArray passes = new JSONArray();
    JSONArray fails = new JSONArray();
    JSONArray skips = new JSONArray();
    JSONArray buildNum = new JSONArray();
    JSONArray durations = new JSONArray();
    JSONArray buildStatus = new JSONArray();
    int count = 0;
    List<? extends AbstractBuild<?, ?>> loadedBuilds = new ArrayList<AbstractBuild<?, ?>>(getProject()._getRuns().getLoadedBuilds().values());
    AbstractBuild<?, ?> build = getProject().getLastBuild();
    for (int i = 0; i < loadedBuilds.size() && count++ < 25; i++) {
        build = loadedBuilds.get(i);
        TestNGTestResultBuildAction action = build.getAction(getBuildActionClass());
        if (build.getResult() == null || build.getResult().isWorseThan(Result.FAILURE)) {
            //We don't want to add aborted or builds with no results into the graph
            continue;
        }
        if (action != null) {
            passes.add(action.getTotalCount() - action.getFailCount() - action.getSkipCount());
            fails.add(action.getFailCount());
            skips.add(action.getSkipCount());
            buildNum.add(Integer.toString(build.getNumber()));
            durations.add(build.getDuration());
            buildStatus.add(build.getResult().color);
        }
    }
    jsonObject.put("pass", passes);
    jsonObject.put("fail", fails);
    jsonObject.put("skip", skips);
    jsonObject.put("buildNum", buildNum);
    jsonObject.put("duration", durations);
    jsonObject.put("buildStatus", buildStatus);
    return jsonObject.toString();
}

[Buggy Hunk]
AbstractBuild<?, ?> build = getProject().getLastBuild();

[Patch]
AbstractBuild<?, ?> build;

[Demonstration 3]

[Buggy Method]
public static List<Set<Integer>> Tarjan(Graphe g) {
    int num = 0;
    //Init de la liste des index
    Map<Integer, SommetTarjan> sommets = new HashMap<Integer, Algorithmes.SommetTarjan>();
    for (Integer sommet : g.getSommets()) {
        sommets.put(sommet, new SommetTarjan(sommet));
    }
    List<Set<Integer>> partition = new ArrayList<Set<Integer>>();
    Deque<Integer> pile = new LinkedList<Integer>();
    for (Integer sommet : g.getSommets()) {
        if (sommets.get(sommet).num == -1)
            parcours(sommet, partition, pile, num, g);
    }
    return partition;
}

[Buggy Hunk]
parcours(sommet, partition, pile, num, g);

[Patch]
parcours(sommet, partition, pile, num, g, sommets);