[Demonstration 1]

[Buggy Method]
public LinkedHashMap<String, Double> subMakeStatistic(LinkedHashMap<String, Integer> results) {
    LinkedHashMap<String, Double> stats = new LinkedHashMap<String, Double>();
    Set<String> subKeys = results.keySet();
    for (String subKey : subKeys) {
        double stat = ((double) results.get(subKey) / result.result.size()) * 100;
        stats.put(subKey, stat);
    }
    return stats;
}

[Buggy Hunk]
double stat = ((double)results.get(subKey) / result.result.size())*100;

[Patch]
double stat = ((double)results.get(subKey) / dataList.size())*100;

[Demonstration 2]

[Buggy Method]
@Override
public Y predict(STrainingSample<X, Y> ts) {
    IStructInstantiation<X, Y> instantiation = this.instantiation();
    double[] w = this.getParameters();
    Set<Y> Y_range = instantiation.enumerateY();
    // loop set
    Y y_pre = null;
    Double max_value = Double.MIN_VALUE;
    // initial max value
    Iterator<Y> itr = Y_range.iterator();
    while (itr.hasNext()) {
        Y y = itr.next();
        double value = VectorOperations.dot(w, instantiation.psi(ts.input, y));
        // check argmax
        if (value > max_value) {
            y_pre = y;
            max_value = value;
        }
    }
    return y_pre;
}

[Buggy Hunk]
Double max_value = Double.MIN_VALUE;

[Patch]
Double max_value = - Double.MAX_VALUE;

[Demonstration 3]

[Buggy Method]
protected double convertDaysToQuantity(Double days, List<Double> forecast) {
    int i = 0;
    double quantity = 0;
    for (double remainingDays = days; remainingDays > 0; remainingDays -= Constants.DAYS_IN_WEEK) {
        if (remainingDays >= Constants.DAYS_IN_WEEK) {
            quantity += forecast.get(i);
        } else {
            quantity += forecast.get(i) * remainingDays / Constants.DAYS_IN_WEEK;
        }
    }
    return quantity;
}

[Buggy Hunk]
for (double remainingDays = days; remainingDays > 0; remainingDays -= Constants.DAYS_IN_WEEK) {

[Patch]
for (double remainingDays = days; remainingDays > 0; remainingDays -= Constants.DAYS_IN_WEEK, i++) {