[Demonstration 1]

[Buggy Method]
@Override
public void startVideoTimeCountingThread(VideoDuration video) {
    final double dbCurrTime = Double.parseDouble(dao.findVideoById(Integer.parseInt(video.getVideoId())).getCurrTime());
    final int videoId = Integer.parseInt(video.getVideoId());
    final double duration = video.getDuration();
    Future<?> future = scheduledService.scheduleAtFixedRate(new Runnable() {

        double startTime = System.nanoTime() / 1000000000.0;

        double endTime = duration;

        @Override
        public void run() {
            double currTime = System.nanoTime() / 1000000000.0 - startTime + dbCurrTime;
            if (currTime <= endTime) {
                System.out.println("Current time - " + (currTime));
                dao.updateVideoTime(videoId, Double.toString(currTime));
            } else {
                System.out.println("Ended - time is " + currTime + " ; duration is " + duration);
                throw new RuntimeException();
            }
        }
    }, 0, 1, TimeUnit.SECONDS);
    countThreadFutureList.add(new FutureHolder(future, video.getRoomId(), video.getVideoId()));
}

[Buggy Hunk]
dao.updateVideoTime(videoId, Double.toString(currTime));

[Patch]
dao.updateVideoTime(videoId, Double.toString(new BigDecimal(currTime).setScale(4, RoundingMode.HALF_UP).doubleValue()));

[Demonstration 2]

[Buggy Method]
@Override
public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion) {
    try {
        WaterTemp.onUpgrade(db, connectionSource, oldVersion, newVersion);
    } catch (SQLException e) {
        e.printStackTrace();
    }
}

[Buggy Hunk]
catch (SQLException e) {

[Patch]
catch (java.sql.SQLException e) {

[Demonstration 3]

[Buggy Method]
@Override
protected void onPreExecute() {
    super.onPreExecute();
    progressDialog = new ProgressDialog(CreateEntryActivity.this);
    progressDialog.setMessage("Please wait...");
    progressDialog.setCancelable(false);
    progressDialog.show();
}

[Buggy Hunk]
progressDialog.setMessage("Please wait...");

[Patch]
progressDialog.setMessage(getResources().getString(R.string.dialog_loading_message_encrypting_data));