[Demonstration 1]

[Buggy Method]
public void delete() throws IOException {
    wal.close();
    wal.delete();
}

[Buggy Hunk]
public void delete() throws IOException {

[Patch]
private void delete() throws IOException {

[Demonstration 2]

[Buggy Method]
public void fillPubDate(Document doc, Document teiCorpusDoc) throws XPathExpressionException {
    try {
        Element dateElt = (Element) xPath.compile("/teiCorpus/teiHeader/fileDesc/sourceDesc/biblStruct/monogr/imprint/date[@type=\"datePub\"]").evaluate(teiCorpusDoc, XPathConstants.NODE);
        if (dateElt == null) {
            dateElt = (Element) xPath.compile("/teiCorpus/teiHeader/fileDesc/sourceDesc/biblStruct/monogr/imprint/date[@type=\"dateDefended\"]").evaluate(teiCorpusDoc, XPathConstants.NODE);
        }
        if (dateElt != null) {
            dateElt.setTextContent(Utilities.completeDate(dateElt.getTextContent()));
        }
        if (dateElt == null || dateElt.getTextContent().contains("0000")) {
            String date = "";
            Element grobidDateElt = (Element) xPath.compile("/TEI/teiHeader/fileDesc/publicationStmt/date[@type=\"published\"]").evaluate(doc, XPathConstants.NODE);
            if (grobidDateElt != null) {
                String grobidDate = grobidDateElt.getTextContent();
                if (!grobidDate.contains("0000")) {
                    grobidDate = Utilities.completeDate(grobidDate);
                    date = grobidDate;
                }
            }
            if (date.isEmpty()) {
                Node submitDate = (Node) xPath.compile("/teiCorpus/teiHeader/fileDesc/editionStmt/edition[@type=\"current\"]/date[@type=\"whenSubmitted\"]").evaluate(teiCorpusDoc, XPathConstants.NODE);
                date = submitDate.getTextContent().split(" ")[0];
            }
            Element newPubDate = teiCorpusDoc.createElement("date");
            newPubDate.setAttribute("type", "datePub");
            newPubDate.setTextContent(date);
            Element eltMonogr = (Element) xPath.compile("/teiCorpus/teiHeader/fileDesc/sourceDesc/biblStruct/monogr").evaluate(teiCorpusDoc, XPathConstants.NODE);
            Element eltImprint = (Element) eltMonogr.getElementsByTagName("imprint").item(0);
            eltImprint = (eltImprint == null) ? doc.createElement("imprint") : eltImprint;
            eltImprint.appendChild(newPubDate);
            eltMonogr.appendChild(eltImprint);
        }
    } catch (XPathExpressionException e) {
        e.printStackTrace();
    }
}

[Buggy Hunk]
String grobidDate = grobidDateElt.getTextContent();

[Patch]
String grobidDate = grobidDateElt.getAttribute("when");

[Demonstration 3]

[Buggy Method]
private void nextPlayer() {
    if (state == ModelState.GAME_OVER)
        throw new RuntimeException("nextPlayer() must not be called while in state " + state.toString());
    if (currentPlayerIterator == null || !currentPlayerIterator.hasNext())
        currentPlayerIterator = players.iterator();
    currentPlayer = currentPlayerIterator.next();
    currentSubScore = 0;
    diceHandler.reserveAllDice();
    state = ModelState.WAITING_FOR_FIRST_ROLL;
    log.add("\n" + "Waiting for " + currentPlayer.getName() + " to roll");
    currentPlayer.beginTurn();
}

[Buggy Hunk]
currentPlayerIterator = players.iterator();

[Patch]
currentPlayerIterator = players.listIterator();