[Demonstration 1]

[Buggy Method]
public static void incompleteForm() {
    Alert alert = createAlert(AlertType.ERROR, "Please enter a source file and an offset time.");
    alert.setTitle("Incomplete form");
    alert.setHeaderText(null);
    alert.showAndWait();
}

[Buggy Hunk]
public static void incompleteForm() {

[Patch]
public void incompleteForm() {

[Demonstration 2]

[Buggy Method]
public static Transaction constructDepositTransaction(List<AccountNo> validAccountNoList, int currentDepositAmount, SessionMode mode) {
    AccountNo accountNo = null;
    String userInput;
    int depositAmount = -1;
    while (accountNo == null) {
        System.out.println("Please enter the account number of the account you wish to deposit to.");
        userInput = sc.next().toLowerCase();
        if (userInput.equals("cancel")) {
            System.out.println("You have cancelled the deposit.");
            return null;
        } else {
            try {
                accountNo = new AccountNo(userInput);
            } catch (Exception e) {
                System.out.println(e.getMessage());
                continue;
            }
            if (validAccountNoList.contains(accountNo)) {
                accountNo = validateAccountNoInput(userInput);
            } else {
                System.out.println("This account does not exist");
                accountNo = null;
            }
        }
    }
    while (depositAmount < 0) {
        System.out.println("Please enter the amount you would like to deposit (in number of cents).");
        userInput = sc.next().toLowerCase();
        if (userInput.equals("cancel")) {
            System.out.println("You have cancelled the deposit.");
            return null;
        } else {
            try {
                int amount = Integer.parseInt(userInput);
                if (amount < 100) {
                    throw new InvalidParameterException();
                }
                if (amount > -1 && mode == SessionMode.ATM && (currentDepositAmount + amount) > SessionMode.ATM.getMaxTransfer()) {
                    System.out.println("Could not complete transaction due to surpassing deposit limit.");
                    return null;
                } else if (mode == SessionMode.AGENT && (currentDepositAmount + amount) > SessionMode.AGENT.getMaxTransfer()) {
                    System.out.println("Could not complete transaction due to surpassing deposit limit.");
                    return null;
                } else {
                    depositAmount = amount;
                }
            } catch (Exception e) {
                System.out.println("Invalid money amount. You must deposit at least 100 cents.");
            }
        }
    }
    return new Transaction(TransactionType.DEPOSIT, accountNo, null, null, depositAmount);
}

[Buggy Hunk]
return new Transaction(TransactionType.DEPOSIT, accountNo, null, null, depositAmount);

[Patch]
return new Transaction(TransactionType.DEPOSIT, null, accountNo, null, depositAmount);

[Demonstration 3]

[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));