mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-18 23:34:15 +01:00
Coverity suggested cleanup
This commit is contained in:
@@ -948,9 +948,7 @@ public class Check extends Update {
|
||||
dealWithReferences();
|
||||
validateConfiguration();
|
||||
populateSettings();
|
||||
Engine engine = null;
|
||||
try {
|
||||
engine = new Engine(Check.class.getClassLoader());
|
||||
try (Engine engine = new Engine(Check.class.getClassLoader())) {
|
||||
if (isUpdateOnly()) {
|
||||
log("Deprecated 'UpdateOnly' property set; please use the UpdateTask instead", Project.MSG_WARN);
|
||||
try {
|
||||
@@ -1002,9 +1000,6 @@ public class Check extends Update {
|
||||
log(msg, ex, Project.MSG_ERR);
|
||||
} finally {
|
||||
Settings.cleanup(true);
|
||||
if (engine != null) {
|
||||
engine.cleanup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -385,9 +385,7 @@ public class Update extends Purge {
|
||||
@Override
|
||||
public void execute() throws BuildException {
|
||||
populateSettings();
|
||||
Engine engine = null;
|
||||
try {
|
||||
engine = new Engine(Update.class.getClassLoader());
|
||||
try (Engine engine = new Engine(Update.class.getClassLoader())) {
|
||||
try {
|
||||
engine.doUpdates();
|
||||
} catch (UpdateException ex) {
|
||||
@@ -404,9 +402,6 @@ public class Update extends Purge {
|
||||
log(msg, Project.MSG_ERR);
|
||||
} finally {
|
||||
Settings.cleanup(true);
|
||||
if (engine != null) {
|
||||
engine.cleanup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user