[Demonstration 1]

[Buggy Method]
private static HomeRunRecordingService parseAndMakeService(String[] args) throws UnknownHostException {
    if (args.length < 4) {
        throw new IllegalArgumentException("Must supply at least 4 arguments");
    }
    InetAddress downloadIp = InetAddress.getByName(args[0]);
    String savePathStr = args[1];
    File savePath = new File(savePathStr);
    if (!savePath.exists() && !savePath.mkdirs()) {
        throw new IllegalArgumentException("Can not create save path: " + savePathStr);
    }
    short maxInParallel = Short.parseShort(args[2]);
    if (maxInParallel < 1) {
        throw new IllegalArgumentException("Must allow at least 1 in parallel stream");
    }
    List<ChannelSchedule> schedule = new ArrayList<ChannelSchedule>(args.length - 2);
    for (int i = 3; i < args.length; i++) {
        int chanDelimIndex = args[i].indexOf(',');
        if (chanDelimIndex < 0) {
            throw new IllegalArgumentException("Could not parse channel from: " + args[i]);
        }
        int timeDelimIndex = args[i].indexOf(':', chanDelimIndex);
        if (timeDelimIndex < 0) {
            throw new IllegalArgumentException("Could not parse time from: " + args[i]);
        }
        int durationDelimIndex = args[i].indexOf(',', timeDelimIndex);
        if (durationDelimIndex < 0) {
            throw new IllegalArgumentException("Could not parse duration from: " + args[i]);
        }
        Collection<Short> recordDays;
        int dayDelimIndex = args[i].indexOf(',', durationDelimIndex + 1);
        if (dayDelimIndex < 0) {
            recordDays = ChannelSchedule.ALL_DAYS;
        } else {
            String days = args[i].substring(dayDelimIndex + 1);
            if (days.length() != 7) {
                throw new IllegalArgumentException("Must supply 0 or 1 for every day to indicate record or not");
            }
            recordDays = new ArrayList<Short>(1);
            for (short d = 0; d < 7; d++) {
                short val = Short.parseShort("0" + days.charAt(d));
                if (val != 0 && val != 1) {
                    throw new IllegalArgumentException("Invalid enable definition for day: " + d + ", value: " + val);
                }
                if (val == 1) {
                    recordDays.add(d);
                }
            }
            if (recordDays.isEmpty()) {
                throw new IllegalArgumentException("Channel not enabled for any days");
            }
        }
        try {
            short channel = Short.parseShort(args[i].substring(0, chanDelimIndex));
            short hour = Short.parseShort(args[i].substring(chanDelimIndex + 1, timeDelimIndex));
            short minute = Short.parseShort(args[i].substring(timeDelimIndex + 1, durationDelimIndex));
            short duration;
            if (dayDelimIndex < 0) {
                duration = Short.parseShort(args[i].substring(durationDelimIndex + 1));
            } else {
                duration = Short.parseShort(args[i].substring(durationDelimIndex + 1, dayDelimIndex));
            }
            schedule.add(new ChannelSchedule(channel, hour, minute, duration, recordDays));
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("Illegal character in parsing channel, time, or duration", e);
        }
    }
    return new HomeRunRecordingService(scheduler, new SchedulerServiceLimiter(scheduler, maxInParallel), downloadIp, savePath, schedule);
}

[Buggy Hunk]
schedule.add(new ChannelSchedule(channel, hour, minute, duration, recordDays));

[Patch]
schedule.add(new ChannelSchedule(channel, hour, minute, duration, recordDays, false));

[Demonstration 2]

[Buggy Method]
@InitBinder
public void dataBindingGlobal(WebDataBinder binder) {
    logger.debug("RestResponseEntityExceptionHandler.dataBindingGlobal()");
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, "dob", new CustomDateEditor(dateFormat, true));
}

[Buggy Hunk]
logger.debug("RestResponseEntityExceptionHandler.dataBindingGlobal()");

[Patch]
log.debug("RestResponseEntityExceptionHandler.dataBindingGlobal()");

[Demonstration 3]

[Buggy Method]
private String minUpdateInterval(String interval1, String interval2) {
    LOG.warn("interval1: {}, interval2: {}", interval1, interval2);
    if (interval1 == null) {
        return interval2;
    } else if (interval2 == null) {
        return interval1;
    }
    int interval1InMin = getIntervalInMinutes(interval1);
    int interval2InMin = getIntervalInMinutes(interval2);
    if (interval1InMin <= interval2InMin) {
        return getUpdatePolicyInterval(interval1InMin);
    } else {
        return getUpdatePolicyInterval(interval2InMin);
    }
}

[Buggy Hunk]
LOG.warn("interval1: {}, interval2: {}", interval1, interval2);

[Patch]
LOG.debug("interval1: {}, interval2: {}", interval1, interval2);