mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-25 18:41:44 +01:00
Issue #419 - Avoiding a duplicate CPE Index Created message and resource leak.
This commit is contained in:
@@ -134,17 +134,19 @@ public class CPEAnalyzer implements Analyzer {
|
|||||||
* process.
|
* process.
|
||||||
*/
|
*/
|
||||||
public void open() throws IOException, DatabaseException {
|
public void open() throws IOException, DatabaseException {
|
||||||
cve = new CveDB();
|
if (!isOpen()) {
|
||||||
cve.open();
|
cve = new CveDB();
|
||||||
cpe = CpeMemoryIndex.getInstance();
|
cve.open();
|
||||||
try {
|
cpe = CpeMemoryIndex.getInstance();
|
||||||
LOGGER.info("Creating the CPE Index");
|
try {
|
||||||
final long creationStart = System.currentTimeMillis();
|
LOGGER.info("Creating the CPE Index");
|
||||||
cpe.open(cve);
|
final long creationStart = System.currentTimeMillis();
|
||||||
LOGGER.info("CPE Index Created ({} ms)", System.currentTimeMillis() - creationStart);
|
cpe.open(cve);
|
||||||
} catch (IndexException ex) {
|
LOGGER.info("CPE Index Created ({} ms)", System.currentTimeMillis() - creationStart);
|
||||||
LOGGER.debug("IndexException", ex);
|
} catch (IndexException ex) {
|
||||||
throw new DatabaseException(ex);
|
LOGGER.debug("IndexException", ex);
|
||||||
|
throw new DatabaseException(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user