[Demonstration 1]

[Buggy Method]
public List<Notification> list(List<String> notifications) throws DAOException {
    try {
        Query<Notification> query = datastore.createQuery(Notification.class);
        List<ObjectId> objectIds = new ArrayList<>();
        for (String noti : notifications) {
            objectIds.add(new ObjectId(noti));
        }
        return query.field("_id").in(objectIds).asList();
    } catch (Exception ex) {
        logger.error("list notificaton errror", ex);
        throw new DAOException();
    }
}

[Buggy Hunk]
logger.error("list notificaton errror", ex);

[Patch]
logger.error("list notificaton errror:" + notifications, ex);

[Demonstration 2]

[Buggy Method]
public void insertEntry(Context context, IEntryHolder entryHolder, boolean shouldReplicate, boolean origin, boolean suppliedUid) throws SAException, EntryAlreadyInSpaceException {
    validateEntryCanBeWrittenToCache(entryHolder);
    final TypeData typeData = _typeDataMap.get(entryHolder.getServerTypeDesc());
    if (entryHolder.getXidOriginatedTransaction() != null) {
        entryHolder.setMaybeUnderXtn(true);
        entryHolder.setWriteLockOwnerAndOperation(entryHolder.getXidOriginated(), SpaceOperations.WRITE, false);
    }
    if (entryHolder.getXidOriginated() != null)
        entryHolder.getXidOriginated().setOperatedUpon();
    IEntryCacheInfo pE = null;
    pE = insertEntryToCache(context, entryHolder, true, /* newEntry */
    typeData, true, /*pin*/
    false);
    if (pE == _entryAlreadyInSpaceIndication) {
        throw new EntryAlreadyInSpaceException(entryHolder.getUID(), entryHolder.getClassName());
    }
    if (entryHolder.getXidOriginatedTransaction() == null) {
        try {
            if (entryHolder.isOffHeapEntry() && isDirectPersistencyEmbeddedtHandlerUsed() && context.isActiveBlobStoreBulk())
                context.setForBulkInsert(entryHolder);
            _storageAdapter.insertEntry(context, entryHolder, origin, shouldReplicate);
            //If should be sent to cluster
            if (shouldReplicate && !context.isDelayedReplicationForbulkOpUsed())
                handleInsertEntryReplication(context, entryHolder);
        } catch (SAException ex) {
            if (!entryHolder.isDeleted()) {
                removeEntryFromCache(entryHolder);
            }
            context.resetRecentFifoObject();
            throw ex;
        }
    }
    //if (entryHolder.m_XidOriginated == null)
}

[Buggy Hunk]
typeData, true /*pin*/,false /*fromInitialLoad*/);

[Patch]
typeData, true /*pin*/,InitialLoadOrigin.NON /*fromInitialLoad*/);

[Demonstration 3]

[Buggy Method]
private JsonArray pack(List<JsonObject> notifications) {
    log.info("Fetched " + notifications + " notifications from Github.");
    log.info("Simplifying notifications, we ony need the repo name and issue number...");
    JsonArrayBuilder parcel = Json.createArrayBuilder();
    for (JsonObject notification : notifications) {
        JsonObject subject = notification.getJsonObject("subject");
        String issueUrl = subject.getString("url");
        parcel.add(Json.createObjectBuilder().add("repoFullName", notification.getJsonObject("repository").getString("full_name")).add("issueNumber", Integer.parseInt(issueUrl.substring(issueUrl.lastIndexOf("/") + 1))).build());
    }
    log.info("Done; notifications are packed and ready to be sent.");
    return parcel.build();
}

[Buggy Hunk]
log.info("Fetched " + notifications + " notifications from Github.");

[Patch]
log.info("Fetched " + notifications.size() + " notifications from Github.");