changed CveDB to a singeton

This commit is contained in:
Jeremy Long
2017-03-07 05:49:12 -05:00
parent 5ed5764ab5
commit 679df936e7
26 changed files with 343 additions and 719 deletions

View File

@@ -944,16 +944,13 @@ public class Check extends Update {
DatabaseProperties prop = null;
CveDB cve = null;
try {
cve = new CveDB();
cve.open();
cve = CveDB.getInstance();
prop = cve.getDatabaseProperties();
} catch (DatabaseException ex) {
//TODO shouldn't this be a fatal exception
log("Unable to retrieve DB Properties", ex, Project.MSG_DEBUG);
} finally {
if (cve != null) {
cve.close();
}
}
final ReportGenerator reporter = new ReportGenerator(getProjectName(), engine.getDependencies(), engine.getAnalyzers(), prop);
reporter.generateReports(reportOutputDirectory, reportFormat);