#vulnerable code 
                                protected List<URL> getVersion(List<URL> list, String driver,
            String version) {
        List<URL> out = new ArrayList<>();
        if (getDriverName().contains("msedgedriver")) {
            int i = listVersions.indexOf(version);
            if (i != -1) {
                out.add(list.get(i));
            }
        }

        for (URL url : list) {
            if (url.getFile().contains(driver)
                    && url.getFile().contains(version)
                    && !url.getFile().contains("-symbols")) {
                out.add(url);
            }
        }

        if (versionToDownload != null && !versionToDownload.equals(version)) {
            versionToDownload = version;
            log.info("Using {} {}", driver, version);
        }
        return out;
    } 
                            #location 5 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                protected List<URL> getVersion(List<URL> list, String driver,
            String version) {
        List<URL> out = new ArrayList<>();
        for (URL url : list) {
            if (url.getFile().contains(driver)
                    && url.getFile().contains(version)
                    && !url.getFile().contains("-symbols")) {
                out.add(url);
            }
        }

        if (versionToDownload != null && !versionToDownload.equals(version)) {
            versionToDownload = version;
            log.info("Using {} {}", driver, version);
        }
        return out;
    }