[Demonstration 1]

[Buggy Method]
private void viewRepo(final String repoID) {
    final SeafRepo repo = mActivity.getDataManager().getCachedRepoByID(repoID);
    if (repo == null) {
        ToastUtils.show(mActivity, getString(R.string.repo_not_found));
        return;
    }
    if (repo.encrypted) {
        handleEncryptedRepo(repo, new TaskDialog.TaskDialogListener() {

            @Override
            public void onTaskSuccess() {
                switchTab(repoID, repo.getName(), repo.getRootDirID());
            }
        });
    } else {
        switchTab(repoID, repo.getName(), repo.getRootDirID());
    }
}

[Buggy Hunk]
handleEncryptedRepo(repo, new TaskDialog.TaskDialogListener() {

[Patch]
mActivity.handleEncryptedRepo(repo, new TaskDialog.TaskDialogListener() {

[Demonstration 2]

[Buggy Method]
private void slaveShutdown(TaskListener listener) throws DockerException, IOException {
    // The slave has stopped. Should we commit / tag / push ?
    if (!getJobProperty().tagOnCompletion) {
        addJenkinsAction(null);
        return;
    }
    DockerClient client = getClient();
    // Commit
    String tag_image = client.commitCmd(containerId).withRepository(theRun.getParent().getDisplayName()).withTag(theRun.getDisplayName()).withAuthor("Jenkins").exec();
    // Tag it with the jenkins name
    addJenkinsAction(tag_image);
    // SHould we add additional tags?
    try {
        String tagToken = getAdditionalTag(listener);
        if (!Strings.isNullOrEmpty(tagToken)) {
            // ?? client.image(tag_image).tag(tagToken, false);
            client.tagImageCmd(tag_image, null, tagToken).exec();
            addJenkinsAction(tagToken);
            if (getJobProperty().pushOnSuccess) {
                client.pushImageCmd(tagToken).exec();
            }
        }
    } catch (Exception ex) {
        LOGGER.log(Level.SEVERE, "Could not add additional tags");
    }
    if (getJobProperty().cleanImages) {
        client.removeImageCmd(tag_image).withForce().exec();
    }
}

[Buggy Hunk]
.withTag(theRun.getDisplayName())

[Patch]
.withTag(theRun.getDisplayName().replace("#","b")) // allowed only ([a-zA-Z_][a-zA-Z0-9_]*)

[Demonstration 3]

[Buggy Method]
public void executeAction(Request request, RoutesTable routesTable) {
    for (RoutesTable.Route route : routesTable.routesTable) {
        if ((route.verb == RoutesTable.Verb.valueOf(request.verb())) && (route.url.equals(request.url()))) {
            route.action.execute(request, this);
        }
    }
}

[Buggy Hunk]
public void executeAction(Request request, RoutesTable routesTable) {

[Patch]
public synchronized void executeAction(Request request, RoutesTable routesTable) {