[Demonstration 1]

[Buggy Method]
private String getTimetableData(String courseCode) {
    String url = new StringBuilder(BASE_URL).append(courseCode).toString();
    return restTemplate.getForObject(url, String.class);
}

[Buggy Hunk]
String url = new StringBuilder(BASE_URL).append(courseCode).toString();

[Patch]
String url = BASE_URL + courseCode;

[Demonstration 2]

[Buggy Method]
@Override
protected void extract(String path, String name) throws IOException {
    try (ZipArchiveInputStream zis = new ZipArchiveInputStream(new BufferedInputStream(new FileInputStream(path + name)))) {
        ArchiveEntry entry = zis.getNextEntry();
        /*create main folder of gzip archive*/
        File folder = new File(path + name.substring(0, 7));
        if (!folder.exists()) {
            folder.mkdir();
        }
        while (entry != null & _runFlag) {
            String entryName = entry.getName();
            /*check if entry contains a directory*/
            if (entryName.contains("/")) {
                File newFile;
                if (Settings._isUnix) {
                    //check OS for correct file path
                    newFile = new File(folder.getAbsolutePath() + "/" + entryName);
                } else {
                    newFile = new File(folder.getAbsolutePath() + "\\" + entryName);
                }
                /*mkdirs also creates parent directories*/
                if (!newFile.getParentFile().exists()) {
                    newFile.getParentFile().mkdirs();
                }
            }
            String newFilePath;
            if (Settings._isUnix) {
                //check OS for correct file path
                newFilePath = folder.getAbsolutePath() + "/" + entryName;
            } else {
                newFilePath = folder.getAbsolutePath() + "\\" + entryName;
            }
            /*create new OutputStream and write bytes to file*/
            try (BufferedOutputStream buf = new BufferedOutputStream(new FileOutputStream(newFilePath))) {
                byte[] buffer = new byte[4096];
                int readBytes;
                while ((readBytes = zis.read(buffer)) != -1) {
                    buf.write(buffer, 0, readBytes);
                }
            }
            entry = zis.getNextEntry();
        }
    }
}

[Buggy Hunk]
File folder = new File(path + name.substring(0, 7));

[Patch]
File folder = new File(Settings._outputPath + name.substring(0, 7));

[Demonstration 3]

[Buggy Method]
public boolean ensureExistance() {
    if (exists())
        return false;
    try {
        getParentFile().mkdirs();
        createNewFile();
    } catch (Exception exception) {
        exception.printStackTrace();
    }
    return true;
}

[Buggy Hunk]
getParentFile().mkdirs();

[Patch]
if(getParentFile()!=null)getParentFile().mkdirs();