[Demonstration 1]

[Buggy Method]
private String cmdBan(String[] opts) {
    if (opts.length != 4) {
        return "Invalid ban parameters.";
    }
    if (opts[1].isEmpty() || opts[2].isEmpty() || opts[3].isEmpty()) {
        return "Invalid parameters - '" + opts[0] + UNIT_SEPARATOR + opts[1] + UNIT_SEPARATOR + opts[2] + UNIT_SEPARATOR + opts[3] + "'";
    }
    if (level < BANPOWER) {
        return "You are not a high enough level to ban";
    }
    ArrayList<Client> c = cod.getPlayerList();
    String str = "";
    for (int i = 0; i < c.size(); i++) {
        Client client = c.get(i);
        if (client.getClientId().equals(opts[1]) && client.getShortGuid().equals(opts[2])) {
            if (levelVsClient(client.getGuid())) {
                try {
                    String[] array = { "", client.getGuid() };
                    String reason = "(RCon) " + opts[3];
                    d.banClient(cmdGetDataId(array), adminid, reason);
                    str = "Ban added to database.\n ";
                } catch (SQLException e) {
                    System.out.println(e.getMessage());
                    str = "Adding ban to database failed...";
                }
                str += cod.sendBan(client.getClientId(), client.getGuid(), opts[3]);
                return str;
            } else {
                return client.getName() + " is a higher/equal level admin.";
            }
        }
    }
    return "ERROR: Client not found in current player list.";
}

[Buggy Hunk]
str += cod.sendBan(client.getClientId(), client.getGuid(), opts[3]);

[Patch]
str += cod.sendBan(client.getClientId(), client.getGuid(), client.getName(), opts[3]);

[Demonstration 2]

[Buggy Method]
private void refreshMemory() {
    ObservableList<MemRow> a = FXCollections.observableArrayList();
    for (int i = 0; i < 4096; ++i) {
        if (pipeline.memory[i] != 0.0) {
            MemRow memRow = new MemRow();
            memRow.setOffset(String.valueOf(i));
            memRow.setValue(String.valueOf(pipeline.memory[i]));
            a.add(memRow);
        }
    }
    memTableView.getItems().addAll(a);
}

[Buggy Hunk]
memTableView.getItems().addAll(a);

[Patch]
memTableView.getItems().setAll(a);

[Demonstration 3]

[Buggy Method]
@Override
public boolean validateScope(OAuth2TokenValidationMessageContext messageContext) throws IdentityOAuth2Exception {
    OAuth2ScopeValidator scopeValidator = OAuthServerConfiguration.getInstance().getoAuth2ScopeValidator();
    //If a scope validator is engaged through the configuration
    if (messageContext.getRequestDTO() != null && messageContext.getRequestDTO().getContext() != null) {
        String resource = null;
        //Iterate the array of context params to find the 'resource' context param.
        for (OAuth2TokenValidationRequestDTO.TokenValidationContextParam resourceParam : messageContext.getRequestDTO().getContext()) {
            //If the context param is the resource that is being accessed
            if (resourceParam != null && "resource".equals(resourceParam.getKey())) {
                resource = resourceParam.getValue();
                break;
            }
        }
        //Return True if there is no resource to validate the token against
        //OR if the token has a valid scope to access the resource. False otherwise.
        return resource == null || scopeValidator.validateScope((AccessTokenDO) messageContext.getProperty("AccessTokenDO"), resource);
    }
    return true;
}

[Buggy Hunk]
if (messageContext.getRequestDTO() != null &&

[Patch]
if (scopeValidator != null && messageContext.getRequestDTO() != null &&