[Demonstration 1]

[Buggy Method]
@Override
public List<Photo> loadInBackground() {
    String[] projection = { MediaStore.Images.Media.DATA, MediaStore.Images.Media._ID };
    // TODO: Order to time
    Cursor imageCursor = getContext().getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, // Which columns to return
    projection, // Return all rows
    null, null, null);
    ArrayList<Photo> result = new ArrayList<>(imageCursor.getCount());
    int dataColumnIndex = imageCursor.getColumnIndex(projection[0]);
    int idColumnIndex = imageCursor.getColumnIndex(projection[1]);
    if (imageCursor.moveToFirst()) {
        do {
            String filePath = imageCursor.getString(dataColumnIndex);
            String imageId = imageCursor.getString(idColumnIndex);
            Uri fullImageUri = Uri.parse(filePath);
            Uri thumbnailUri = uriToThumbnail(imageId);
            Photo photo = new Photo(thumbnailUri, fullImageUri);
            result.add(photo);
        } while (imageCursor.moveToNext());
    }
    imageCursor.close();
    return result;
}

[Buggy Hunk]
Cursor imageCursor = getContext().getContentResolver().query(

[Patch]
Cursor imageCursor = contentResolver.query(

[Demonstration 2]

[Buggy Method]
public boolean fullHouse() {
    if (this.pair() && this.threeOfAKind()) {
        return true;
    }
    return false;
}

[Buggy Hunk]
if(this.pair()&&this.threeOfAKind()){

[Patch]
if(pair()&&threeOfAKind()){

[Demonstration 3]

[Buggy Method]
private ModelAndView getWorkflow(GitDetails gitDetails, RedirectAttributes redirectAttrs) {
    // Get workflow
    QueuedWorkflow queued = null;
    Workflow workflowModel = workflowService.getWorkflow(gitDetails);
    if (workflowModel == null) {
        // Check if already queued
        queued = workflowService.getQueuedWorkflow(gitDetails);
        if (queued == null) {
            // Validation
            WorkflowForm workflowForm = new WorkflowForm(gitDetails.getUrl());
            BeanPropertyBindingResult errors = new BeanPropertyBindingResult(workflowForm, "errors");
            workflowFormValidator.validateAndParse(workflowForm, errors);
            if (!errors.hasErrors()) {
                try {
                    queued = workflowService.createQueuedWorkflow(gitDetails);
                } catch (GitAPIException ex) {
                    errors.rejectValue("url", "git.retrievalError", "The workflow could not be retrieved from the Git repository using the details given");
                    logger.error("Git API Error", ex);
                } catch (WorkflowNotFoundException ex) {
                    errors.rejectValue("url", "git.pathTraversal", "The path given did not resolve to a location within the repository");
                } catch (IOException ex) {
                    errors.rejectValue("url", "url.parsingError", "The workflow could not be parsed from the given URL");
                }
            }
            // Redirect to main page with errors if they occurred
            if (errors.hasErrors()) {
                redirectAttrs.addFlashAttribute("errors", errors);
                return new ModelAndView("redirect:/?url=" + gitDetails.getUrl());
            }
        }
    }
    // Display this model along with the view
    if (queued != null) {
        // Retry creation if there has been an error in cwltool parsing
        if (queued.getCwltoolStatus() == CWLToolStatus.ERROR) {
            workflowService.retryCwltool(queued);
        }
        return new ModelAndView("loading", "queued", queued);
    } else {
        return new ModelAndView("workflow", "workflow", workflowModel);
    }
}

[Buggy Hunk]
workflowService.retryCwltool(queued);

[Patch]
workflowService.retryCreate(queued);