[Demonstration 1]

[Buggy Method]
private void processORB() {
    Bitmap img = FeatureDetectorAlgorithms.ORB(mGray, mGray2);
    if (img == null) {
        Log.i(TAG, "erro errado");
    } else
        imageView.setImageBitmap(img);
}

[Buggy Hunk]
Bitmap img = FeatureDetectorAlgorithms.ORB(mGray, mGray2);

[Patch]
Bitmap img = FeatureDetectorAlgorithms.ORB(mRgba, mRgba2);

[Demonstration 2]

[Buggy Method]
public static Result service(String ownerName, String projectName, String service, boolean isAdvertise) throws IOException, UnsupportedOperationException, ServletException {
    if (!isSupportedService(service)) {
        return forbidden(String.format("Unsupported service: '%s'", service));
    }
    Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
    if (project == null) {
        return notFound();
    }
    models.User user = UserApp.currentUser();
    if (!isAllowed(project, service)) {
        if (user.isAnonymous()) {
            return BasicAuthAction.unauthorized(response());
        } else {
            // If you want the Git client showing your custom message to
            // the user, the Content-Type should be exact "text/plain"
            // without any parameter. For more details, see the code at
            // https://github.com/git/git/commit/426e70d4a11ce3b4f70636d57c6a0ab16ae08a00#diff-eea0ad565ec5903a11b6023755d491cfR154
            response().setHeader("Content-Type", "text/plain");
            return forbidden(String.format("'%s' has no permission to '%s/%s'.", user.name, ownerName, projectName));
        }
    }
    if (isAdvertise) {
        return ok(RepositoryService.gitAdvertise(project, service, response()));
    } else {
        if (request().body().isMaxSizeExceeded()) {
            return status(REQUEST_ENTITY_TOO_LARGE);
        } else {
            user.visits(project);
            return ok(RepositoryService.gitRpc(project, service, request(), response()));
        }
    }
}

[Buggy Hunk]
user.name, ownerName, projectName));

[Patch]
user.loginId, ownerName, projectName));

[Demonstration 3]

[Buggy Method]
private void process() throws InterruptedException {
    FNTDprogress.startMessage("Calculating and subtracting background...");
    int nSlices = this.img.getNSlices();
    int nFrames = this.img.getNFrames();
    int nChannels = this.img.getNChannels();
    ImageStack resIms = new ImageStack(this.img.getWidth(), this.img.getHeight());
    ImageStack bkgIms = new ImageStack(this.img.getWidth(), this.img.getHeight());
    int curSlice = this.img.getSlice();
    int curFrame = this.img.getFrame();
    int curChannel = this.img.getChannel();
    int total = nSlices * nFrames * nChannels;
    double prog = 0;
    ExecutorService exec = Executors.newFixedThreadPool(total);
    CountDownLatch latch = new CountDownLatch(total);
    BackgroundSubtractorUnit[] runnables = new BackgroundSubtractorUnit[total];
    int rIndex = 0;
    for (int i = 0; i < nChannels; i++) {
        for (int j = 0; j < nFrames; j++) {
            for (int k = 0; k < nSlices; k++) {
                runnables[rIndex++] = new BackgroundSubtractorUnit(i, j, k, this.img, this.fo);
            }
        }
    }
    FNTDprogress fp = new FNTDprogress();
    fp.startProgressThread(latch, total);
    for (BackgroundSubtractorUnit r : runnables) {
        r.setLatch(latch);
        exec.execute(r);
    }
    latch.await();
    exec.shutdown();
    fp.stopProgressThread();
    /* Collect results and convert to tracks */
    rIndex = 0;
    for (int i = 0; i < nChannels; i++) {
        for (int j = 0; j < nFrames; j++) {
            for (int k = 0; k < nSlices; k++) {
                resIms.addSlice(runnables[rIndex].getResultingImage());
                bkgIms.addSlice(runnables[rIndex++].getBackgroundImage());
            }
        }
    }
    String orgTitle = this.img.getTitle();
    bimg = new ImagePlus();
    bimg.setStack(resIms, img.getNChannels(), img.getNSlices(), img.getNFrames());
    bimg.setOpenAsHyperStack(true);
    bimg.setTitle("Background of " + orgTitle);
    nimg = new ImagePlus();
    nimg.setStack(resIms, img.getNChannels(), img.getNSlices(), img.getNFrames());
    nimg.setOpenAsHyperStack(true);
    nimg.setTitle("Backgroundsubtracted copy of " + orgTitle);
    FNTDprogress.finishMessage("Done.", true);
}

[Buggy Hunk]
bimg.setStack(resIms, img.getNChannels(), img.getNSlices(), img.getNFrames());

[Patch]
bimg.setStack(bkgIms, img.getNChannels(), img.getNSlices(), img.getNFrames());