[Demonstration 1]

[Buggy Method]
public static void main(String[] args) {
    try (JavaSparkContext jsc = Spark.getContext("MMDS Wiki");
        HDFS fs = HDFS.getLocal()) {
        Edits test = new Edits(jsc, TEST_DIR);
        Edits training = new Edits(jsc, TRAINING_DIR);
        MultiRecommender recommender = new MultiRecommender().add(CollaborativeFiltering.load(jsc, CF_DIR, fs)).add(CategoryAnalyzer.load(jsc, CAT_DIR)).add(new LDA());
        Evaluator eval = new Evaluator(recommender, test, training, new File(OUT_FILE));
        eval.evaluate(200, 100);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

[Buggy Hunk]
.add(CategoryAnalyzer.load(jsc, CAT_DIR)).add(new LDA());

[Patch]
.add(CategoryAnalyzer.load(jsc, CAT_DIR)).add(LDA_Recommender.load(jsc.sc(), LDA_DIR));

[Demonstration 2]

[Buggy Method]
private void jump(Giant g) {
    final Location center = g.getLocation();
    g.setVelocity(new Vector(0, 7, 0));
    List<Location> close = Lists.newArrayList();
    List<Location> medium = Lists.newArrayList();
    List<Location> far = Lists.newArrayList();
    for (int degrees = 0; degrees < 361; degrees = degrees + 45) {
        close.add(calculateCircle(center, degrees, 3));
    }
    for (int degrees = 0; degrees < 361; degrees = degrees + 45) {
        medium.add(calculateCircle(center, degrees, 5));
    }
    for (int degrees = 0; degrees < 361; degrees = degrees + 45) {
        far.add(calculateCircle(center, degrees, 10));
    }
    explode(close, 2, 3);
    explode(medium, 4, 2);
    explode(far, 6, 1);
}

[Buggy Hunk]
g.setVelocity(new Vector(0, 7, 0));

[Patch]
g.setVelocity(new Vector(0, 4.5, 0));

[Demonstration 3]

[Buggy Method]
private static double calculateStressInternal(int threadIdx, double[] preX, int targetDim, double tCur, short[] distances, WeightsWrap1D weights) {
    StressInternalTimings.startTiming(StressInternalTimings.TimingTask.COMP, threadIdx);
    double sigma = 0.0;
    double diff = 0.0;
    if (tCur > 10E-10) {
        diff = Math.sqrt(2.0 * targetDim) * tCur;
    }
    int threadRowCount = ParallelOps.threadRowCounts[threadIdx];
    final int globalRowOffset = ParallelOps.threadRowStartOffsets[threadIdx] + ParallelOps.procRowStartOffset;
    int globalColCount = ParallelOps.globalColCount;
    int globalRow, procLocalRow;
    double origD, weight, euclideanD;
    double heatD, tmpD;
    for (int localRow = 0; localRow < threadRowCount; ++localRow) {
        globalRow = localRow + globalRowOffset;
        procLocalRow = globalRow - ParallelOps.procRowStartOffset;
        for (int globalCol = 0; globalCol < globalColCount; globalCol++) {
            origD = distances[localRow * globalColCount + globalCol] * INV_SHORT_MAX;
            weight = weights.getWeight(procLocalRow, globalCol);
            if (origD < 0 || weight == 0) {
                continue;
            }
            euclideanD = globalRow != globalCol ? calculateEuclideanDist(preX, globalRow, globalCol, targetDim) : 0.0;
            heatD = origD - diff;
            tmpD = origD >= diff ? heatD - euclideanD : -euclideanD;
            sigma += weight * tmpD * tmpD;
        }
    }
    StressInternalTimings.endTiming(StressInternalTimings.TimingTask.COMP, threadIdx);
    return sigma;
}

[Buggy Hunk]
origD = distances[localRow * globalColCount + globalCol]

[Patch]
origD = distances[procLocalRow * globalColCount + globalCol]