[Demonstration 1]

[Buggy Method]
public static ArrayList<ListViewItem> selectDB() {
    Cursor c = db.query(myDatabaseHelper.getDatabaseName(), null, null, null, null, null, null);
    int dateIndex = c.getColumnIndex("date");
    int textIndex = c.getColumnIndex("text");
    int idIndex = c.getColumnIndex("id");
    ArrayList<ListViewItem> list = new ArrayList<>();
    if (c.moveToFirst()) {
        do {
            list.add(new ListViewItem(Integer.valueOf(c.getString(idIndex)), c.getString(textIndex), c.getString(dateIndex)));
        } while (c.moveToNext());
    }
    c.close();
    return list;
}

[Buggy Hunk]
Cursor c = db.query(myDatabaseHelper.getDatabaseName(), null, null, null, null, null, null);

[Patch]
Cursor c = db.query(noteDBHelper.getDatabaseName(), null, null, null, null, null, null);

[Demonstration 2]

[Buggy Method]
private LocalDate getBelowStartDate(PhasePaneWrapper phase) {
    LocalDate date = null;
    PhasePaneWrapper below = getPhaseBelow(phase);
    if (below == null)
        return null;
    if (!phase.isSubPhase() && below.isSubPhase()) {
        date = getBelowStartDate(below);
    } else if (phase.isSubPhase() && !below.isSubPhase() && !subPhases.get(below).isEmpty()) {
        date = getBelowStartDate(below);
    } else {
        date = below.getPhaseBegin();
    }
    return date;
}

[Buggy Hunk]
}else if(phase.isSubPhase() && !below.isSubPhase() && !subPhases.get(below).isEmpty()){

[Patch]
}else if(phase.isSubPhase() && !below.isSubPhase() && subPhases.get(below) != null && !subPhases.get(below).isEmpty()){

[Demonstration 3]

[Buggy Method]
public Word getWord(String word) {
    return dictionaryMap.get(word);
}

[Buggy Hunk]
public Word getWord(String word) {

[Patch]
public WordObject getWord(String word){