[Demonstration 1]

[Buggy Method]
public void exceptionCaught(IoSession session, Throwable cause) {
    log.error(session.getRemoteAddress() + " EXCEPTION", cause);
    session.close(true);
}

[Buggy Hunk]
log.error( session.getRemoteAddress() + " EXCEPTION", cause );

[Patch]
LOG.error( session.getRemoteAddress() + " EXCEPTION", cause );

[Demonstration 2]

[Buggy Method]
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_detail_job_post);
    mDetailJobPostActivity = this;
    ButterKnife.bind(this);
    toolbar.setTitle("");
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    mDetailJobPostPresenter = new DetailJobPendingPresenter(this);
    lo_clear_job.setOnClickListener(this);
    lo_infoOwner.setOnClickListener(this);
    rela_confirm_maid.setOnClickListener(this);
    final Intent intent = getIntent();
    mDatum = (Datum) intent.getSerializableExtra("mDatum");
    if (!WorkTimeValidate.compareDays(mDatum.getInfo().getTime().getEndAt())) {
        txtExpired_request_detail_post.setVisibility(View.VISIBLE);
    } else {
        txtExpired_request_detail_post.setVisibility(View.GONE);
    }
    if (mDatum.getInfo().getTools()) {
        txtIsTools.setVisibility(View.VISIBLE);
    } else {
        txtIsTools.setVisibility(View.GONE);
    }
    if (mDatum.getProcess().getId().equals("000000000000000000000006")) {
        txtClearJob.setText(getResources().getString(R.string.denied));
        rela_confirm_maid.setVisibility(View.VISIBLE);
    } else {
        txtClearJob.setText(getResources().getString(R.string.cancel_work));
        rela_confirm_maid.setVisibility(View.GONE);
    }
    txtNameOwner.setText(mDatum.getStakeholders().getOwner().getInfo().getName());
    txtAddressOwner.setText((mDatum.getStakeholders().getOwner().getInfo().getAddress().getName()));
    txtTitle_job_detail_post.setText(mDatum.getInfo().getTitle());
    txtType_job_detail_post.setText(mDatum.getInfo().getWork().getName());
    txtContent_job_detail_psot.setText(mDatum.getInfo().getDescription());
    txtPrice_job_detail_post.setText(formatPrice(mDatum.getInfo().getPrice()));
    txtAddress_detail_post.setText(mDatum.getInfo().getAddress().getName());
    txtDate_job_detail_post.setText(WorkTimeValidate.getDatePostHistory(mDatum.getHistory().getUpdateAt()));
    txtTime_work_doing_detail_post.setText(WorkTimeValidate.getTimeWork(mDatum.getInfo().getTime().getStartAt()) + " - " + WorkTimeValidate.getTimeWork(mDatum.getInfo().getTime().getEndAt()));
    Glide.with(this).load(mDatum.getStakeholders().getOwner().getInfo().getImage()).error(R.drawable.avatar).thumbnail(0.5f).diskCacheStrategy(DiskCacheStrategy.RESULT).placeholder(R.drawable.avatar).dontAnimate().into(img_avatarQwner);
    Picasso.with(this).load(mDatum.getInfo().getWork().getImage()).error(R.drawable.no_image).placeholder(R.drawable.no_image).into(imgType_job_detail_post);
    //        Picasso.with(this).load(mDatum.getStakeholders().getOwner().getInfo().getImage())
    //                .error(R.drawable.avatar)
    //                .placeholder(R.drawable.avatar)
    //                .into(img_avatarQwner);
}

[Buggy Hunk]
txtPrice_job_detail_post.setText(formatPrice(mDatum.getInfo().getPrice()));

[Patch]
txtPrice_job_detail_post.setText(String.format("%s VND", NumberFormat.getNumberInstance(Locale.GERMANY).format(mDatum.getInfo().getPrice())));

[Demonstration 3]

[Buggy Method]
@Override
protected void afterExecute(Runnable r, Throwable t) {
    super.afterExecute(r, t);
    Throwable throwable = t;
    // Unwrap possible exceptions if the runnable is actually a Future
    if (t == null && r instanceof Future<?>) {
        try {
            Future<?> future = (Future<?>) r;
            future.get();
        } catch (CancellationException e) {
            throwable = e;
        } catch (ExecutionException e) {
            throwable = e.getCause();
        } catch (InterruptedException e) {
            throwable = e;
        }
    }
    for (ExecutorObserver executorObserver : executorObservers) {
        try {
            executorObserver.afterExecute(r, throwable);
        } catch (Exception e) {
            logger.severe("Error when notifying observer: " + e.getMessage());
            e.printStackTrace();
        }
    }
    if (activeTaskCounter.get() != 0) {
        for (ExecutorObserver executorObserver : executorObservers) {
            try {
                executorObserver.tasksFinished();
            } catch (Exception e) {
                logger.severe("Error when notifying observer: " + e.getMessage());
                e.printStackTrace();
            }
        }
    }
}

[Buggy Hunk]
if (activeTaskCounter.get() != 0)

[Patch]
if (activeTaskCounter.decrementAndGet() == 0)