[Demonstration 1]

[Buggy Method]
public byte[] getBytesForDataResource(DataResource dataResource) throws IOException, InvalidInputException {
    logger.log("Fetching Bytes for Data Item", Severity.INFORMATIONAL, new AuditElement("access", "getBytesForData", dataResource.getDataId()));
    FileLocation fileLocation = ((RasterDataType) dataResource.getDataType()).getLocation();
    FileAccessFactory fileAccessFactory = getFileFactoryForDataResource(dataResource);
    return IOUtils.toByteArray(fileAccessFactory.getFile(fileLocation));
}

[Buggy Hunk]
FileLocation fileLocation = ((RasterDataType) dataResource.getDataType()).getLocation();

[Patch]
FileLocation fileLocation = ((FileRepresentation) dataResource.getDataType()).getLocation();

[Demonstration 2]

[Buggy Method]
@Override
public TranslatedEntry getNextEntryToTranslateAndSave(TranslatedEntry entryToSave, Language destinationLanguage) {
    TranslatedEntry nextEntry = getNextEntryToTranslate();
    BufferedReader file = null;
    String lines = "";
    try {
        file = new BufferedReader(new FileReader(filePath));
        String line;
        int i = 0;
        while ((line = file.readLine()) != null) {
            i++;
            if (i == entryToSave.getDestLineNumber()) {
                String[] localisations = line.split(";");
                // TODO : Save also the source language ?
                localisations[destinationLanguage.getDefaultColumn()] = entryToSave.getDestination();
                line = "";
                for (String s : localisations) {
                    line += s + ";";
                }
                // Add the line without the last semicolon
                line = line.substring(0, line.length() - 1);
            }
            lines += line + System.lineSeparator();
        }
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        try {
            if (file != null)
                file.close();
        } catch (IOException e) {
            throw new IllegalArgumentException(e.getMessage());
        }
    }
    PrintWriter writer = null;
    try {
        writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(filePath), StandardCharsets.ISO_8859_1), true);
        writer.print(lines);
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        if (writer != null)
            writer.close();
    }
    return nextEntry;
}

[Buggy Hunk]
new FileOutputStream(filePath), StandardCharsets.ISO_8859_1), true);

[Patch]
new FileOutputStream(filePath), "windows-1252"), true);

[Demonstration 3]

[Buggy Method]
public String getFileLocation() {
    if (this.fileLocation == null) {
        this.fileLocation = "";
    }
    if (!this.fileLocation.contains("lettxResults")) {
        this.fileLocation += "\\lettxResults";
    }
    return this.fileLocation;
}

[Buggy Hunk]
this.fileLocation += "\\lettxResults";

[Patch]
this.fileLocation += File.separator + "lettxResults";