output: #fixed code
                                  protected List<URL> filterCandidateUrls(Architecture arch, String version,
              boolean getLatest) throws IOException {
          List<URL> urls = getDrivers();
          List<URL> candidateUrls;
          log.trace("All URLs: {}", urls);
  
          boolean continueSearchingVersion;
          do {
              // Get the latest or concrete version
              String filterName = getDriverName().equalsIgnoreCase("msedgedriver")
                      ? "edgedriver"
                      : getDriverName();
              candidateUrls = getLatest ? checkLatest(urls, filterName)
                      : getVersion(urls, filterName, version);
              log.trace("Candidate URLs: {}", candidateUrls);
              if (versionToDownload == null) {
                  break;
              }
  
              // Filter by OS
              if (!getDriverName().equalsIgnoreCase("IEDriverServer")
                      && !getDriverName()
                              .equalsIgnoreCase("selenium-server-standalone")) {
                  candidateUrls = urlFilter.filterByOs(candidateUrls,
                          config().getOs());
              }
  
              // Filter by architecture
              candidateUrls = urlFilter.filterByArch(candidateUrls, arch,
                      forcedArch);
  
              // Filter by distro
              candidateUrls = filterByDistro(candidateUrls);
  
              // Filter by ignored versions
              candidateUrls = filterByIgnoredVersions(candidateUrls);
  
              // Find out if driver version has been found or not
              continueSearchingVersion = candidateUrls.isEmpty() && getLatest;
              if (continueSearchingVersion) {
                  log.info(
                          "No binary found for {} {} ... seeking another version",
                          getDriverName(), versionToDownload);
                  urls = removeFromList(urls, versionToDownload);
                  versionToDownload = null;
              }
          } while (continueSearchingVersion);
          return candidateUrls;
      }
input: #vulnerable code 
                                  protected List<URL> filterCandidateUrls(Architecture arch, String version,
              boolean getLatest) throws IOException {
          List<URL> urls = getDrivers();
          List<URL> candidateUrls;
          log.trace("All URLs: {}", urls);
  
          boolean continueSearchingVersion;
          do {
              // Get the latest or concrete version
              candidateUrls = getLatest ? checkLatest(urls, getDriverName())
                      : getVersion(urls, getDriverName(), version);
              log.trace("Candidate URLs: {}", candidateUrls);
              if (versionToDownload == null
                      || this.getClass().equals(EdgeDriverManager.class)) {
                  break;
              }
  
              // Filter by OS
              if (!getDriverName().equalsIgnoreCase("IEDriverServer")
                      && !getDriverName()
                              .equalsIgnoreCase("selenium-server-standalone")) {
                  candidateUrls = urlFilter.filterByOs(candidateUrls,
                          config().getOs());
              }
  
              // Filter by architecture
              candidateUrls = urlFilter.filterByArch(candidateUrls, arch,
                      forcedArch);
  
              // Filter by distro
              candidateUrls = filterByDistro(candidateUrls);
  
              // Filter by ignored versions
              candidateUrls = filterByIgnoredVersions(candidateUrls);
  
              // Find out if driver version has been found or not
              continueSearchingVersion = candidateUrls.isEmpty() && getLatest;
              if (continueSearchingVersion) {
                  log.info(
                          "No binary found for {} {} ... seeking another version",
                          getDriverName(), versionToDownload);
                  urls = removeFromList(urls, versionToDownload);
                  versionToDownload = null;
              }
          } while (continueSearchingVersion);
          return candidateUrls;
      } 
                              #location 11 
                              #vulnerability type THREAD_SAFETY_VIOLATION