[Demonstration 1]

[Buggy Method]
public int run(String[] args) throws Exception {
    Configuration conf = new Configuration();
    int numberOfPartitions = 0;
    long milliSeconds = 1000 * 60 * 60;
    conf.setLong("mapreduce.task.timeout", milliSeconds);
    List<String> other_args = new ArrayList<>();
    for (int i = 0; i < args.length; ++i) {
        try {
            if ("-p".equals(args[i])) {
                numberOfPartitions = Integer.parseInt(args[++i]);
                conf.setInt("numberOfPartitions", numberOfPartitions);
            } else {
                other_args.add(args[i]);
            }
        } catch (NumberFormatException except) {
            System.out.println("ERROR: Integer expected instead of " + args[i]);
        } catch (ArrayIndexOutOfBoundsException except) {
            System.out.println("ERROR: Required parameter missing from " + args[i - 1]);
        }
    }
    if (other_args.size() != 3) {
        System.out.println("Please specify inputFolder, dynamicPartitionFolder, outputFolder");
    }
    String dynamicPartitionFolder = other_args.get(1);
    conf.set("dynamicPartitionFolder", dynamicPartitionFolder);
    Job job = Job.getInstance(conf);
    job.setNumReduceTasks(numberOfPartitions + 1);
    job.setJarByClass(DynamicQuery.class);
    job.setJobName("DynamicQuery");
    job.setInputFormatClass(TextInputFormat.class);
    LazyOutputFormat.setOutputFormatClass(job, TextOutputFormat.class);
    job.setMapOutputKeyClass(IntervalKey.class);
    job.setMapOutputValueClass(Interval.class);
    job.setOutputKeyClass(NullWritable.class);
    job.setOutputValueClass(Text.class);
    job.setMapperClass(CustomMapper.class);
    job.setReducerClass(CustomReducer.class);
    FileInputFormat.addInputPath(job, new Path(other_args.get(0)));
    FileSystem fs = FileSystem.get(conf);
    Path outputFolder = new Path(other_args.get(2));
    if (fs.exists(outputFolder)) {
        fs.delete(outputFolder, true);
    }
    FileOutputFormat.setOutputPath(job, outputFolder);
    return job.waitForCompletion(true) ? 0 : 1;
}

[Buggy Hunk]
job.setMapOutputValueClass(Interval.class);

[Patch]
job.setMapOutputValueClass(IntervalWritable.class);

[Demonstration 2]

[Buggy Method]
@Override
public void onLeftCardExit(Object dataObject) {
    if (list.size() == 0)
        Toast.makeText(AddContactsActivity.this, "no more users!", Toast.LENGTH_LONG).show();
    else
        makeToast(AddContactsActivity.this, "dislike");
}

[Buggy Hunk]
if (list.size() == 0)

[Patch]
if (list.size() <0)

[Demonstration 3]

[Buggy Method]
@Override
public Set<String> getTableNames() {
    try (Statement stmt = connection.createStatement();
        ResultSet rs = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + "table_schema='public' AND table_type='BASE TABLE'")) {
        Set tables = new LinkedHashSet<>();
        while (rs.next()) {
            tables.add(rs.getString("table_name"));
        }
        return tables;
    } catch (SQLException e) {
        throw new IllegalArgumentException("Bad request to the DataBase");
    }
}

[Buggy Hunk]
throw new IllegalArgumentException("Bad request to the DataBase");

[Patch]
throw new IllegalArgumentException(e.getMessage());