[Demonstration 1]

[Buggy Method]
@Override
public void cancelEdit() {
    super.cancelEdit();
    this.setText(this.converter.toString(this.getItem()));
    this.setGraphic(null);
}

[Buggy Hunk]
this.setText(this.converter.toString(this.getItem()));

[Patch]
this.setText(this.getStringConverter().toString(this.getItem()));

[Demonstration 2]

[Buggy Method]
@Override
public int finduseridbydocid(int docid) {
    // TODO Auto-generated method stub
    Session session = sessionFactory.openSession().getSession();
    session.beginTransaction();
    Query query = session.createSQLQuery("SELECT userid FROM documents WHERE docid =?");
    query.setParameter(0, docid);
    int userid = (int) query.list().get(0);
    session.getTransaction().commit();
    session.close();
    System.out.println("The userid in the dao layer is " + userid);
    return userid;
}

[Buggy Hunk]
Session session = sessionFactory.openSession().getSession();

[Patch]
Session session = sessionFactory.openSession();

[Demonstration 3]

[Buggy Method]
public void onSendComplete(final byte[] deliveryTag, final DeliveryState outcome) {
    TRACE_LOGGER.log(Level.FINE, String.format("linkName[%s]", this.sendLink.getName()));
    ReplayableWorkItem<Void> pendingSendWorkItem = this.pendingSendWaiters.get(deliveryTag);
    if (pendingSendWorkItem != null) {
        CompletableFuture<Void> pendingSend = pendingSendWorkItem.getWork();
        if (outcome instanceof Accepted) {
            this.retryPolicy.resetRetryCount(this.getClientId());
            this.pendingSendWaiters.remove(deliveryTag);
            pendingSend.complete(null);
        } else if (outcome instanceof Rejected) {
            Rejected rejected = (Rejected) outcome;
            ErrorCondition error = rejected.getError();
            Exception exception = ExceptionUtil.toException(error);
            Duration retryInterval = this.retryPolicy.getNextRetryInterval(this.getClientId(), exception, pendingSendWorkItem.getTimeoutTracker().remaining());
            if (retryInterval == null) {
                this.pendingSendWaiters.remove(deliveryTag);
                ExceptionUtil.completeExceptionally(pendingSend, exception, this);
            } else {
                pendingSendWorkItem.setLastKnownException(exception);
                Timer.schedule(new Runnable() {

                    @Override
                    public void run() {
                        MessageSender.this.reSend(deliveryTag, false);
                    }
                }, retryInterval, TimerType.OneTimeRun);
            }
        } else {
            this.pendingSendWaiters.remove(deliveryTag);
            ExceptionUtil.completeExceptionally(pendingSend, new ServiceBusException(false, outcome.toString()), this);
        }
    }
}

[Buggy Hunk]
TRACE_LOGGER.log(Level.FINE, String.format("linkName[%s]", this.sendLink.getName()));

[Patch]
TRACE_LOGGER.log(Level.FINEST, String.format("linkName[%s]", this.sendLink.getName()));