[Demonstration 1]

[Buggy Method]
public void show(final CanvasHandler canvasHandler) {
    // Initialize the widgets.
    canvasPreview.start(canvasHandler.getCanvas());
    treeExplorer.show(canvasHandler);
    // Show the view.
    card.show(canvasPreview.asWidget(), treeExplorer.asWidget(), null);
}

[Buggy Hunk]
card.show(canvasPreview.asWidget(), treeExplorer.asWidget(), null);

[Patch]
card.show(canvasPreview.asWidget(), treeExplorer.asWidget() );

[Demonstration 2]

[Buggy Method]
@RequestMapping(value = "/inbox", method = RequestMethod.POST)
public void receiveFile(@RequestParam(value = "recipient_id", required = false) Integer recipientId, @RequestParam(value = "sender_id", required = false) Integer senderId, @RequestParam(value = "signer_id", required = false) Integer signerId, @RequestParam(value = "file") MultipartFile multipartFile, @RequestParam(value = "signature") MultipartFile signatureFile, @RequestParam(value = "file_format", required = false) String fileFormat, @RequestParam(value = "document_type", required = false) String documentType, @RequestParam(value = "department", required = false) String department, @RequestParam(value = "transaction_id", required = false) Integer transactionId, @RequestParam(value = "ack_url", required = false) String ackURL, @RequestParam(value = "transcript_request_file", required = false) MultipartFile transcriptRequestFile, HttpServletRequest request) {
    log.info(request.getRequestURI().toString());
    log.debug(String.format("received file from network server " + recipientId));
    if (multipartFile == null || signatureFile == null) {
        log.error("Incorrect number of file uploaded.  Is the digital signature file present?");
        throw new WebApplicationException("A file and it's digital signature are required.");
    }
    Transaction tx = new Transaction();
    // we need the directoryId for this organization in the organizations table
    tx.setRecipientId(recipientId);
    tx.setSenderId(senderId);
    tx.setSignerId(signerId);
    tx.setSenderTransactionId(transactionId);
    tx.setFileFormat(fileFormat);
    tx.setFileSize(multipartFile.getSize());
    tx.setDepartment(department);
    tx.setDocumentType(documentType);
    tx.setOperation("RECEIVE");
    Timestamp occurredAt = new Timestamp(Calendar.getInstance().getTimeInMillis());
    tx.setOccurredAt(occurredAt);
    tx.setAcknowledgedAt(occurredAt);
    tx.setAcknowledged(true);
    tx.setStatus(TransactionStatus.FAILURE);
    if (!StringUtils.isEmpty(ackURL)) {
        tx.setAckURL(ackURL);
    }
    File inboxDirectory = new File(localServerInboxPath);
    inboxDirectory.mkdirs();
    try {
        String fileName = multipartFile.getOriginalFilename();
        File uploadedFile = new File(inboxDirectory, fileName);
        byte[] bytes = multipartFile.getBytes();
        String requestFileName = null;
        File requestFile = null;
        byte[] requestFileBytes = null;
        if (transcriptRequestFile != null) {
            requestFileName = transcriptRequestFile.getOriginalFilename();
            requestFile = new File(inboxDirectory, requestFileName);
            requestFileBytes = transcriptRequestFile.getBytes();
        }
        String pemPublicKey = getPEMPublicKeyByOrgID(signerId);
        if (pemPublicKey == null) {
            throw new IllegalArgumentException("The sender's signing certificate was invalid or non existent.  File discarded.");
        }
        PublicKey senderPublicKey = pkiService.convertPEMPublicKey(pemPublicKey);
        if (true == pkiService.verifySignature(signatureFile.getInputStream(), signatureFile.getBytes(), senderPublicKey)) {
            throw new WebApplicationException("Invalid digital signature found.  File discarded.");
        }
        File fp = uploadedFile.getParentFile();
        if (!fp.exists() && !fp.mkdirs()) {
            tx.setError("Could not create directory: " + fp);
        } else {
            try {
                if (!uploadedFile.createNewFile()) {
                    tx.setError(String.format("file %s already exists", multipartFile.getOriginalFilename()));
                } else {
                    tx.setFilePath(uploadedFile.getPath());
                    BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(uploadedFile));
                    stream.write(bytes);
                    stream.close();
                    //Now save the transcript request file if it exists.
                    if (requestFile != null) {
                        if (!requestFile.createNewFile()) {
                            String message = tx.getError() != null ? tx.getError() : "";
                            tx.setError(message + ". " + String.format("file %s already exists", requestFileName));
                        } else {
                            tx.setRequestFilePath(requestFile.getPath());
                            BufferedOutputStream stream2 = new BufferedOutputStream(new FileOutputStream(requestFile));
                            stream2.write(requestFileBytes);
                            stream2.close();
                            tx.setStatus(TransactionStatus.SUCCESS);
                        }
                    } else {
                        tx.setStatus(TransactionStatus.SUCCESS);
                    }
                }
            } catch (IOException ioex) {
                tx.setMessage(ioex.getMessage());
                tx.setError(ioex.getMessage());
            }
        }
    } catch (Exception ex) {
        log.error(ex);
        tx.setMessage(ex.getMessage() == null ? ex.getClass().getSimpleName() : ex.getMessage());
        tx.setError(ex.getMessage() == null ? ex.getClass().getSimpleName() : ex.getMessage());
    }
    transactionService.update(tx);
    if (tx.getStatus() == TransactionStatus.SUCCESS) {
        fileProcessorService.deliverFile(tx);
    }
}

[Buggy Hunk]
if ( true == pkiService.verifySignature(signatureFile.getInputStream(),signatureFile.getBytes(), senderPublicKey)) {

[Patch]
if ( false == pkiService.verifySignature(multipartFile.getInputStream(),signatureFile.getBytes(), senderPublicKey)) {

[Demonstration 3]

[Buggy Method]
private void renderTableEntity(EntityBundle bundle, String entityTypeDisplay, EntityHeader projectHeader, String areaToken) {
    // tab container
    setTabSelected(EntityArea.TABLES, false);
    // add breadcrumbs
    tableBreadcrumbContainer.add(breadcrumb.asWidget(bundle.getPath(), EntityArea.TABLES));
    // TODO: Add table name?
    // Entity Metadata
    entityMetadata.setEntityBundle(bundle, versionNumber);
    tableMetadataContainer.add(entityMetadata.asWidget());
    // ActionMenu
    actionMenu = createEntityActionMenu(bundle, null);
    tableActionMenuContainer.add(actionMenu.asWidget());
    // Table
    QueryChangeHandler qch = new QueryChangeHandler() {

        @Override
        public void onQueryChange(Query newQuery) {
            presenter.setTableQuery(newQuery);
        }

        @Override
        public Query getQueryString() {
            return presenter.getTableQuery();
        }

        @Override
        public void onPersistSuccess(EntityUpdatedEvent event) {
            presenter.fireEntityUpdatedEvent();
        }
    };
    IsWidget tableWidget = null;
    // V2
    TableEntityWidget v2TableWidget = ginInjector.createNewTableEntityWidget();
    v2TableWidget.configure(bundle, bundle.getPermissions().getCanCertifiedUserEdit(), qch, actionMenu);
    tableWidget = v2TableWidget;
    Widget tableW = tableWidget.asWidget();
    tableWidgetContainer.add(tableW);
    // Created By/Modified By
    tableModifiedAndCreatedContainer.add(createModifiedAndCreatedWidget(bundle.getEntity(), false));
}

[Buggy Hunk]
actionMenu = createEntityActionMenu(bundle, null);

[Patch]
resetEntityActionMenu(bundle, null);