From 9d0a5da783269b742d06f3015408073ea8c6a4f7 Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Thu, 6 Jul 2017 05:27:37 -0400 Subject: [PATCH] fix issue #783 --- .../dependencycheck/data/update/NvdCveUpdater.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/NvdCveUpdater.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/NvdCveUpdater.java index 13ea1c412..ee26e8dbd 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/NvdCveUpdater.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/NvdCveUpdater.java @@ -516,7 +516,7 @@ public class NvdCveUpdater implements CachedWebDataSource { final Map> timestampFutures = new HashMap<>(); for (String url : urls) { - final TimestampRetriever timestampRetriever = new TimestampRetriever(url); + final TimestampRetriever timestampRetriever = new TimestampRetriever(url, Settings.getInstance()); final Future future = downloadExecutorService.submit(timestampRetriever); timestampFutures.put(url, future); } @@ -544,6 +544,10 @@ public class NvdCveUpdater implements CachedWebDataSource { */ private static class TimestampRetriever implements Callable { + /** + * A reference to the global settings object. + */ + private final Settings settings; /** * The URL to obtain the timestamp from. */ @@ -553,16 +557,18 @@ public class NvdCveUpdater implements CachedWebDataSource { * Instantiates a new timestamp retriever object. * * @param url the URL to hit + * @param settings the global settings */ - TimestampRetriever(String url) { + TimestampRetriever(String url, Settings settings) { this.url = url; + this.settings = settings; } @Override public Long call() throws Exception { LOGGER.debug("Checking for updates from: {}", url); try { - Settings.initialize(); + Settings.setInstance(settings); return Downloader.getLastModified(new URL(url)); } finally { Settings.cleanup(false);