[Demonstration 1]

[Buggy Method]
public static File getApplicationExecutable() {
    if (SystemInfo.isMac) {
        File executable = new File(getApplicationBaseDir(), "Contents/MacOs/JavaAppLauncher");
        return executable.exists() ? executable : null;
    }
    if (SystemInfo.isWindows) {
        File executable = new File(getApplicationBaseDir(), "colt.exe");
        return executable.exists() ? executable : null;
    }
    if (SystemInfo.isLinux) {
        File executable = new File(getApplicationBaseDir(), "colt");
        return executable.exists() ? executable : null;
    }
    throw new IllegalStateException("Unsupported OS: " + System.getProperty("os.name"));
}

[Buggy Hunk]
File executable = new File(getApplicationBaseDir(), "colt.exe");

[Patch]
File executable = new File(getApplicationBaseDir().getParent(), "colt.exe");

[Demonstration 2]

[Buggy Method]
public void prepare() {
    try {
        path.getParent().toFile().mkdirs();
        if (playlistManager.isDASH()) {
            jsonPath = Paths.get(path.getParent().toString() + File.separator + filename + File.separator + "status.json");
        } else {
            jsonPath = Paths.get(path.getParent().toString() + File.separator + filename + "_part" + File.separator + "status.json");
        }
        jsonPath.getParent().toFile().mkdirs();
        partPath = jsonPath.getParent();
        Path playlistPath;
        if (playlistManager.isDASH()) {
            playlistPath = Paths.get(jsonPath.getParent().toString() + File.separator + filename + ".mpd");
            writeToDashPlaylist(playlistPath);
        } else {
            playlistPath = Paths.get(path.getParent().toString() + File.separator + filename + "_part" + File.separator + filename + ".m3u8");
            writeToPlaylist(playlistPath);
        }
        statusJSON = readJSON(jsonPath);
        if (statusJSON != null) {
            try {
                long CRC = FileUtils.checksumCRC32(playlistPath.toFile());
                if (statusJSON.containsKey("CRC32")) {
                    long oldCRC = (long) statusJSON.get("CRC32");
                    if (CRC == oldCRC) {
                        progress = (int) (long) statusJSON.get("Progress");
                    } else {
                        System.out.println("File exists. Continue?(Y/N)");
                        Scanner scanner = new Scanner(System.in);
                        String chosen = scanner.nextLine();
                        if (chosen.toLowerCase().equals("y") || chosen.toLowerCase().equals("yes")) {
                            if (statusJSON.containsKey("Key")) {
                                statusJSON.replace("Key", false);
                            }
                        } else {
                            System.exit(0);
                        }
                    }
                } else {
                    System.out.println("File exists. Continue?(Y/N)");
                    Scanner scanner = new Scanner(System.in);
                    String chosen = scanner.nextLine();
                    if (chosen.toLowerCase().equals("y") || chosen.toLowerCase().equals("yes")) {
                        if (statusJSON.containsKey("Key")) {
                            statusJSON.replace("Key", false);
                        }
                    } else {
                        System.exit(0);
                    }
                    statusJSON.put("CRC32", CRC);
                }
            } catch (Exception e) {
            }
        } else if (path.toFile().exists()) {
            System.out.println("File exists. Continue?(Y/N)");
            Scanner scanner = new Scanner(System.in);
            String chosen = scanner.next();
            if (!(chosen.toLowerCase().equals("y") || chosen.toLowerCase().equals("yes"))) {
                System.exit(0);
            }
        }
        long CRC = FileUtils.checksumCRC32(playlistPath.toFile());
        if (statusJSON == null) {
            statusJSON = new JSONObject();
            statusJSON.put("CRC32", CRC);
        } else if (!statusJSON.containsKey("CRC32")) {
            statusJSON.put("CRC32", CRC);
        } else {
            statusJSON.replace("CRC32", CRC);
        }
        BufferedWriter videoWriter = null;
        if (!playlistManager.isDASH()) {
            videoWriter = new BufferedWriter(new FileWriter(path.toFile(), false));
        }
        BufferedWriter jsonWriter = new BufferedWriter(new FileWriter(jsonPath.toFile(), true));
        jsonWriter.close();
        if (playlistManager.isDASH()) {
            downloadDASH(progress);
        } else {
            downloadHLS(progress);
            videoWriter.close();
            System.out.println("Converting video...");
            new HLSDecrypter(path, raw);
        }
    } catch (IOException e) {
        System.err.println("Write permission not allowed: " + e.getMessage());
        System.exit(-1);
    }
}

[Buggy Hunk]
} else if (path.toFile().exists()) {

[Patch]
} else if (!playlistManager.isDASH() && path.toFile().exists()) {

[Demonstration 3]

[Buggy Method]
public List<List<Double>> CalDocumentVector(List<String> inputWordList, ArrayList<String> vocabulary, double[][] t_matrix) {
    List<List<Double>> DocumentVector = new ArrayList<List<Double>>();
    File f = new File("./LawIE/DocVector/Output");
    FilenameFilter textFilter = new FilenameFilter() {

        public boolean accept(File dir, String name) {
            return name.toLowerCase().endsWith(".txt");
        }
    };
    File[] files = f.listFiles(textFilter);
    for (int docIndex = 0; docIndex < files.length; docIndex++) {
        try {
            String fileName = (files[docIndex]).getCanonicalPath();
            DocumentVector.add(docVector(fileName, docIndex, inputWordList, vocabulary, t_matrix));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    return DocumentVector;
}

[Buggy Hunk]
File f = new File("./LawIE/DocVector/Output");

[Patch]
File f = new File(output_folder);