[Demonstration 1]

[Buggy Method]
private Val atom(Lex lex) {
    Token t = lex.nextToken();
    if (t.isOperator("(")) {
        Val lval = flow(lex);
        Token tc = lex.nextToken();
        if (!tc.isOperator(")")) {
            throw new EvalException("syntax error: unexpected end of expression - ) is expected, found " + tc + " instead");
        }
        return lval;
    } else if (t.type == Token.TokenType.number) {
        return new Num(t.getDouble());
    } else if (t.type == Token.TokenType.string) {
        return new Str("" + t.value);
    } else if (t.type == Token.TokenType.id) {
        return callmaybe(lex, new Id("" + t.value));
    }
    lex.retToken();
    return Nil.NIL;
}

[Buggy Hunk]
return new Str("" + t.value);

[Patch]
return callmaybe(lex, new Str("" + t.value));

[Demonstration 2]

[Buggy Method]
@RequestMapping(value = "/formSubmit", method = RequestMethod.POST)
@ResponseBody
public String formSubmit(@RequestBody FormSubmitData formData) {
    String eventUUIDstring = appService.getEventUUID().toString();
    if (formData.nifiEndpoint.endsWith("/contentListener")) {
        List<JsonObject> postedJsons = new ArrayList<>();
        if (!formData.files.isEmpty()) {
            for (FormSubmitFileData fileData : formData.files) {
                JsonObject json = new JsonObject();
                json.addProperty("eventUUID", eventUUIDstring);
                json.addProperty("actionPathID", formData.actionPathId);
                json.addProperty("filePath", fileData.filepath);
                json.addProperty("fileName", fileData.filename);
                json.addProperty("isRaw", fileData.isRaw);
                json.addProperty("standalone", appService.isStandalone());
                json.addProperty("savePath", new File("ouptut/" + OsUtilities.getFilename(eventUUIDstring)).toPath().toAbsolutePath().toString());
                postedJsons.add(json);
                try {
                    sendPost("http://" + formData.nifiEndpoint, json);
                } catch (Exception e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            if (appService.isStandalone()) {
                UUID eventUUID = appService.getEventUUID();
                File outFile = OsUtilities.getFile(eventUUID.toString() + ".nifi");
                FileOutputStream fos = null;
                DataOutputStream dos = null;
                try {
                    fos = new FileOutputStream(outFile, true);
                    dos = new DataOutputStream(fos);
                    for (JsonObject json : postedJsons) {
                        dos.writeChars(json.toString());
                        dos.writeChars(System.lineSeparator());
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                } finally {
                    try {
                        if (dos != null) {
                            dos.close();
                        }
                        if (fos != null) {
                            fos.close();
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    } else {
        JsonObject json = new JsonObject();
        json.addProperty("eventUUID", eventUUIDstring);
        json.addProperty("responseParams", formData.responseParams);
        try {
            sendPost("http://" + formData.nifiEndpoint, json);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    return "ok";
}

[Buggy Hunk]
json.addProperty("savePath", new File("ouptut/" + OsUtilities.getFilename(eventUUIDstring))

[Patch]
json.addProperty("savePath", new File(OsUtilities.getFilename("output/" + eventUUIDstring))

[Demonstration 3]

[Buggy Method]
private void expressao(int nLinha, ArrayList<Token> arrayExpr) {
    ArrayList<Token> tokenExpr = new ArrayList<>();
    ArrayList<Token> tokenExpPrec = new ArrayList<>();
    boolean isExpr = false;
    int posExpr = 0;
    for (int i = 0; i < arrayExpr.size(); i++) {
        Token t = arrayExpr.get(i);
        String simbol = t.getSimbolo();
        //Pegar a ultima soma ou subtração para enviar depois para expressao prec
        if ("(".equals(simbol) || ")".equals(simbol)) {
            break;
        }
        if ("sum".equals(simbol) || "sub".equals(simbol)) {
            isExpr = true;
            posExpr = i;
        }
    }
    if (isExpr) {
        if (posExpr == (arrayExpr.size() - 1) || posExpr == 0) {
            Lexemas lex = new Lexemas();
            String lexema = arrayExpr.get(posExpr).getLexema();
            if (!lex.getLexema(lexema).isEmpty()) {
                erros.add(new SintaticoException(nLinha, "Palavra-chave /" + lexema + "/ reservada."));
            } else {
                erros.add(new SintaticoException(nLinha, "Token /" + lexema + "/ inesperado."));
            }
        }
        for (int i = 0; i < arrayExpr.size(); i++) {
            Token t = arrayExpr.get(i);
            if (i < posExpr) {
                tokenExpr.add(t);
            } else if (i > posExpr) {
                tokenExpPrec.add(t);
            }
        }
        if (!tokenExpr.isEmpty()) {
            expressao(nLinha, tokenExpr);
            tokenExpr.clear();
        }
        if (!tokenExpPrec.isEmpty()) {
            expressaoPrec(nLinha, tokenExpPrec);
            tokenExpPrec.clear();
        }
    } else {
        expressaoPrec(nLinha, arrayExpr);
    }
}

[Buggy Hunk]
if (!lex.getLexema(lexema).isEmpty()) {

[Patch]
if (lex.getLexema(lexema) != null) {