[Demonstration 1]

[Buggy Method]
private void setInterval(IntervalDateTime interval) {
    this.interval = interval;
    // SETS THE START OF INTERVAL
    if (interval.getStart() != null) {
        startDatePicker.setValue(interval.getStart().toLocalDate());
        startTimeField.setText(interval.getStart().toLocalTime().toString());
    }
    // SETS THE END OF INTERVAL
    if (interval.getStart() != null) {
        endDatePicker.setValue(interval.getEnd().toLocalDate());
        endTimeField.setText(interval.getEnd().toLocalTime().toString());
    }
}

[Buggy Hunk]
if (interval.getStart() != null) {

[Patch]
if (interval.getEnd() != null) {

[Demonstration 2]

[Buggy Method]
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
    // Handle navigation view item clicks here.
    int id = item.getItemId();
    if (id == R.id.nav_payment) {
        Payment obj = new Payment();
        getSupportFragmentManager().beginTransaction().replace(R.id.content, obj).commit();
        // Handle the camera action
    } else if (id == R.id.nav_destination) {
        Destination obj = new Destination();
        getSupportFragmentManager().beginTransaction().replace(R.id.content, obj).commit();
    } else if (id == R.id.nav_recommendation) {
        Recommendation obj = new Recommendation();
        getSupportFragmentManager().beginTransaction().replace(R.id.content, obj).commit();
    } else if (id == R.id.nav_map) {
        Map obj = new Map();
        getFragmentManager().beginTransaction().replace(R.id.content, obj).commit();
    } else if (id == R.id.nav_share) {
    } else if (id == R.id.nav_send) {
    }
    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    drawer.closeDrawer(GravityCompat.START);
    return true;
}

[Buggy Hunk]
getFragmentManager().beginTransaction().replace(R.id.content,obj).commit();

[Patch]
getSupportFragmentManager().beginTransaction().replace(R.id.content,obj).commit();

[Demonstration 3]

[Buggy Method]
public static List<Term> getTerms(Context context) {
    List<String> terms = new ArrayList<>();
    Calendar cal = Calendar.getInstance();
    List<Curriculum> mCurriculum = getCurricula(context);
    if (mCurriculum == null) {
        mCurriculum = new ArrayList<>();
    }
    if (mCurriculum.size() == 0) {
        ExecutorService es = Executors.newFixedThreadPool(1);
        try {
            es.submit(new ImportCurriculaTask(AppUtils.getAccount(context), context)).get();
        } catch (InterruptedException | ExecutionException e) {
            Analytics.sendException(context, e, true);
        } finally {
            es.shutdown();
        }
        try {
            List<Assessment> assessments = getAssessments(context);
            Date dtStart = null;
            for (Assessment assessment : assessments) {
                Date date = assessment.getDate();
                if (date != null) {
                    if (dtStart == null || date.before(dtStart)) {
                        dtStart = date;
                    }
                }
            }
            if (dtStart != null) {
                // subtract -1 term for sure
                cal.setTime(dtStart);
                cal.add(Calendar.MONTH, -6);
                dtStart = cal.getTime();
                mCurriculum.add(new Curriculum(dtStart, null));
            }
        } catch (Exception e) {
            Analytics.sendException(context, e, false);
        }
    }
    // always load current term, subtract -1 term for sure
    cal.setTime(new Date());
    cal.add(Calendar.MONTH, -6);
    mCurriculum.add(new Curriculum(cal.getTime(), null));
    if (mCurriculum.size() > 0) {
        // calculate terms from curricula duration
        cal.setTime(new Date());
        cal.add(Calendar.MONTH, 1);
        Date then = cal.getTime();
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        int year = 2010;
        cal.set(Calendar.YEAR, year);
        cal.set(Calendar.MONTH, Calendar.MARCH);
        cal.set(Calendar.DAY_OF_MONTH, 1);
        // 1.3.
        Date startSS = cal.getTime();
        cal.set(Calendar.YEAR, year);
        cal.set(Calendar.MONTH, Calendar.OCTOBER);
        cal.set(Calendar.DAY_OF_MONTH, 1);
        // 1.10.
        Date startWS = cal.getTime();
        while (startSS.before(then) || startWS.before(then)) {
            if (startSS.before(then) && dateInRange(startSS, mCurriculum)) {
                terms.add(String.format("%dS", year));
            }
            if (startWS.before(then) && dateInRange(startWS, mCurriculum)) {
                terms.add(String.format("%dW", year));
            }
            // inc year
            year++;
            cal.setTime(startSS);
            cal.set(Calendar.YEAR, year);
            startSS.setTime(cal.getTimeInMillis());
            cal.setTime(startWS);
            cal.set(Calendar.YEAR, year);
            startWS.setTime(cal.getTimeInMillis());
        }
    }
    /*
        if (terms.size() == 0) {
            // get Terms from Data, may take a little bit longer
        }
        */
    Collections.sort(terms, TermComparator);
    List<Term> objects = new ArrayList<>();
    try {
        for (String term : terms) {
            objects.add(Term.parseTerm(term));
        }
    } catch (ParseException e) {
        Analytics.sendException(context, e, true);
        objects.clear();
    }
    return Collections.unmodifiableList(objects);
}

[Buggy Hunk]
ExecutorService es = Executors.newFixedThreadPool(1);

[Patch]
ExecutorService es = Executors.newSingleThreadExecutor();