[Demonstration 1]

[Buggy Method]
@Override
protected void save(final AuditMessage msg) {
    try {
        final IndexRequestBuilder irb = clientProvider.get().prepareIndex(index, type).setRefresh(true).setSource(msg.auditInfo);
        irb.putHeader(ConfigConstants.SG_CONF_REQUEST_HEADER, "true");
        irb.setTimeout(TimeValue.timeValueMinutes(1));
        irb.execute(new ActionListener<IndexResponse>() {

            @Override
            public void onResponse(final IndexResponse response) {
                if (log.isTraceEnabled()) {
                    log.trace("audit message {} written to {}/{}", msg, response.getIndex(), response.getType());
                }
            }

            @Override
            public void onFailure(final Throwable e) {
                log.error("Unable to write audit log {} due to {}", e, msg, e.toString());
            }
        });
    } catch (final Exception e) {
        log.error("Unable to write audit log {} due to {}", e, msg, e.toString());
    }
}

[Buggy Hunk]
final IndexRequestBuilder irb = clientProvider.get().prepareIndex(index, type).setRefresh(true).setSource(msg.auditInfo);

[Patch]
final IndexRequestBuilder irb = clientProvider.get().prepareIndex(index, type).setRefresh(true).setSource(msg.getAsMapWithStringKeys());

[Demonstration 2]

[Buggy Method]
@Override
public ExecutionState execute(GameObject executingObject) {
    if (executingObject instanceof Mazub)
        ((Mazub) executingObject).startDuck();
    else {
        executingObject.getProgram().setStatementsLeft(0);
        executingObject.getProgram().setRunTimeError(false);
        return ExecutionState.NOTDONE;
    }
    return ExecutionState.DONE;
}

[Buggy Hunk]
executingObject.getProgram().setRunTimeError(false);

[Patch]
executingObject.getProgram().setRunTimeError(true);

[Demonstration 3]

[Buggy Method]
static public void copyDirTree(String fromDirName, String toDirName) throws IOException {
    File fromDir = new File(fromDirName);
    File toDir = new File(toDirName);
    if (!fromDir.exists())
        return;
    if (!toDir.exists()) {
        if (!toDir.mkdirs()) {
            String msg = "FAILED to create target directory '" + toDir.getAbsolutePath() + "' Unable to copy content from '" + fromDir.getAbsolutePath() + "'";
            log.error("copyDirTree() - {}", msg);
            throw new IOException(msg);
        }
    }
    File[] files = fromDir.listFiles();
    if (files == null) {
        log.error("copyDirTree() - Unable to locate directory {}. Not content will be copied. THIS IS BAD.", fromDirName);
        return;
    }
    for (int i = 0; i < files.length; i++) {
        File f = files[i];
        if (f.isDirectory())
            copyDirTree(f.getAbsolutePath(), toDir.getAbsolutePath() + "/" + f.getName());
        else
            copyFile(f.getAbsolutePath(), toDir.getAbsolutePath() + "/" + f.getName());
    }
}

[Buggy Hunk]
log.error("copyDirTree() - {}",msg);

[Patch]
LoggerFactory.getLogger(PersistentConfigurationHandler.class).error("copyDirTree() - {}",msg);