mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-19 07:44:23 +01:00
set objects to null after closing them
Former-commit-id: 3d62a1b66741d69730e39413b8d99b670d744b50
This commit is contained in:
@@ -154,9 +154,11 @@ public class CPEAnalyzer implements Analyzer {
|
|||||||
public void close() {
|
public void close() {
|
||||||
if (cpe != null) {
|
if (cpe != null) {
|
||||||
cpe.close();
|
cpe.close();
|
||||||
|
cpe = null;
|
||||||
}
|
}
|
||||||
if (cve != null) {
|
if (cve != null) {
|
||||||
cve.close();
|
cve.close();
|
||||||
|
cve = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class EngineVersionCheck implements CachedWebDataSource {
|
|||||||
final boolean updateNeeded = shouldUpdate(lastChecked, now, properties, currentVersion);
|
final boolean updateNeeded = shouldUpdate(lastChecked, now, properties, currentVersion);
|
||||||
if (updateNeeded) {
|
if (updateNeeded) {
|
||||||
LOGGER.warn("A new version of dependency-check is available. Consider updating to version {}.",
|
LOGGER.warn("A new version of dependency-check is available. Consider updating to version {}.",
|
||||||
updateToVersion);
|
updateToVersion);
|
||||||
}
|
}
|
||||||
} catch (DatabaseException ex) {
|
} catch (DatabaseException ex) {
|
||||||
LOGGER.debug("Database Exception opening databases to retrieve properties", ex);
|
LOGGER.debug("Database Exception opening databases to retrieve properties", ex);
|
||||||
@@ -115,8 +115,8 @@ public class EngineVersionCheck implements CachedWebDataSource {
|
|||||||
* @param properties the database properties object
|
* @param properties the database properties object
|
||||||
* @param currentVersion the current version of dependency-check
|
* @param currentVersion the current version of dependency-check
|
||||||
* @return <code>true</code> if a newer version of the database has been released; otherwise <code>false</code>
|
* @return <code>true</code> if a newer version of the database has been released; otherwise <code>false</code>
|
||||||
* @throws UpdateException thrown if there is an error connecting to the github documentation site or accessing the
|
* @throws UpdateException thrown if there is an error connecting to the github documentation site or accessing the local
|
||||||
* local database.
|
* database.
|
||||||
*/
|
*/
|
||||||
protected boolean shouldUpdate(final long lastChecked, final long now, final DatabaseProperties properties,
|
protected boolean shouldUpdate(final long lastChecked, final long now, final DatabaseProperties properties,
|
||||||
String currentVersion) throws UpdateException {
|
String currentVersion) throws UpdateException {
|
||||||
@@ -172,6 +172,7 @@ public class EngineVersionCheck implements CachedWebDataSource {
|
|||||||
if (cveDB != null) {
|
if (cveDB != null) {
|
||||||
try {
|
try {
|
||||||
cveDB.close();
|
cveDB.close();
|
||||||
|
cveDB = null;
|
||||||
} catch (Throwable ignore) {
|
} catch (Throwable ignore) {
|
||||||
LOGGER.trace("Error closing the cveDB", ignore);
|
LOGGER.trace("Error closing the cveDB", ignore);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user