[Demonstration 1]

[Buggy Method]
public boolean start(Writer writer) {
    //Create an iterator status if the status attribute was set.
    if (statusAttr != null) {
        statusState = new IteratorStatus.StatusState();
        status = new IteratorStatus(statusState);
    }
    if (beginStr != null)
        begin = (Integer) findValue(beginStr, Integer.class);
    if (endStr != null)
        end = (Integer) findValue(endStr, Integer.class);
    if (stepStr != null)
        step = (Integer) findValue(stepStr, Integer.class);
    ValueStack stack = getStack();
    if (value == null && begin == null && end == null) {
        value = "top";
    }
    Object iteratorTarget = findValue(value);
    iterator = MakeIterator.convert(iteratorTarget);
    if (begin != null) {
        //default step to 1
        if (step == null)
            step = 1;
        if (iterator == null) {
            //classic for loop from 'begin' to 'end'
            iterator = new CounterIterator(begin, end, step, null);
        } else {
            //only arrays and lists are supported
            if (iteratorTarget.getClass().isArray()) {
                Object[] values = (Object[]) iteratorTarget;
                if (end == null)
                    end = step > 0 ? values.length - 1 : 0;
                iterator = new CounterIterator(begin, end, step, Arrays.asList(values));
            } else if (iteratorTarget instanceof List) {
                List values = (List) iteratorTarget;
                if (end == null)
                    end = step > 0 ? values.size() - 1 : 0;
                iterator = new CounterIterator(begin, end, step, values);
            } else {
                //so the iterator is not based on an array or a list
                LOG.error("Incorrect use of the iterator tag. When 'begin' is set, 'value' must be" + " an Array or a List, or not set at all. 'begin', 'end' and 'step' will be ignored");
            }
        }
    }
    // get the first
    if ((iterator != null) && iterator.hasNext()) {
        Object currentValue = iterator.next();
        stack.push(currentValue);
        String var = getVar();
        if ((var != null) && (currentValue != null)) {
            putInContext(currentValue);
        }
        // Status object
        if (statusAttr != null) {
            statusState.setLast(!iterator.hasNext());
            oldStatus = stack.getContext().get(statusAttr);
            stack.getContext().put(statusAttr, status);
        }
        return true;
    } else {
        super.end(writer, "");
        return false;
    }
}

[Buggy Hunk]
if ((var != null) && (currentValue != null)) {

[Patch]
if ((var != null)) {

[Demonstration 2]

[Buggy Method]
public void startSongActivity(View view) {
    Intent chordIntent = new Intent(this, SongsActivity.class);
    startActivity(chordIntent);
}

[Buggy Hunk]
Intent chordIntent = new Intent(this, SongsActivity.class);

[Patch]
Intent chordIntent = new Intent(this, SongManagementActivity.class);

[Demonstration 3]

[Buggy Method]
public static CitySimulation readScenario(String databasePath, String outputPath) throws IOException {
    CitySimulation simulation = null;
    Connection conn = null;
    try {
        Class.forName("org.sqlite.JDBC");
        conn = DriverManager.getConnection(String.format("jdbc:sqlite:%s", databasePath));
        simulation = readScenario(conn, databasePath, outputPath);
    } catch (ClassNotFoundException | SQLException ex) {
        LOGGER.error(String.format("Failed to read scenario from %s.", databasePath), ex);
        throw new IOException("Failed to read scenario");
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
    return simulation;
}

[Buggy Hunk]
} catch (ClassNotFoundException|SQLException ex) {

[Patch]
} catch (ClassNotFoundException|SQLException|IOException ex) {