fixed issues related to making the cveDb a singleton

This commit is contained in:
Jeremy Long
2017-03-31 06:58:37 -04:00
parent 539bd754df
commit e2a1a59543
20 changed files with 153 additions and 110 deletions

View File

@@ -282,10 +282,15 @@ public class App {
exCol = ex;
}
final List<Dependency> dependencies = engine.getDependencies();
final CveDB cve = CveDB.getInstance();
final DatabaseProperties prop = cve.getDatabaseProperties();
DatabaseProperties prop = null;
try (CveDB cve = CveDB.getInstance()) {
prop = cve.getDatabaseProperties();
} catch (DatabaseException ex) {
//TODO shouldn't this be a fatal exception
LOGGER.debug("Unable to retrieve DB Properties", ex);
}
final ReportGenerator report = new ReportGenerator(applicationName, dependencies, engine.getAnalyzers(), prop);
CveDB.close();
try {
report.generateReports(reportDirectory, outputFormat);
} catch (ReportException ex) {