mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-26 19:11:29 +01:00
cleanup/code style
This commit is contained in:
@@ -225,7 +225,7 @@ public class NvdCveUpdater extends BaseUpdater implements CachedWebDataSource {
|
|||||||
//next, move the future future processTasks to just future processTasks
|
//next, move the future future processTasks to just future processTasks
|
||||||
final Set<Future<ProcessTask>> processFutures = new HashSet<Future<ProcessTask>>(maxUpdates);
|
final Set<Future<ProcessTask>> processFutures = new HashSet<Future<ProcessTask>>(maxUpdates);
|
||||||
for (Future<Future<ProcessTask>> future : downloadFutures) {
|
for (Future<Future<ProcessTask>> future : downloadFutures) {
|
||||||
Future<ProcessTask> task = null;
|
Future<ProcessTask> task;
|
||||||
try {
|
try {
|
||||||
task = future.get();
|
task = future.get();
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
@@ -280,8 +280,9 @@ public class NvdCveUpdater extends BaseUpdater implements CachedWebDataSource {
|
|||||||
* @throws UpdateException Is thrown if there is an issue with the last
|
* @throws UpdateException Is thrown if there is an issue with the last
|
||||||
* updated properties file
|
* updated properties file
|
||||||
*/
|
*/
|
||||||
protected final UpdateableNvdCve getUpdatesNeeded() throws MalformedURLException, DownloadFailedException, UpdateException {
|
final UpdateableNvdCve getUpdatesNeeded() throws MalformedURLException, DownloadFailedException, UpdateException {
|
||||||
UpdateableNvdCve updates = null;
|
LOGGER.info("starting getUpdatesNeeded() ...");
|
||||||
|
UpdateableNvdCve updates;
|
||||||
try {
|
try {
|
||||||
updates = retrieveCurrentTimestampsFromWeb();
|
updates = retrieveCurrentTimestampsFromWeb();
|
||||||
} catch (InvalidDataException ex) {
|
} catch (InvalidDataException ex) {
|
||||||
|
|||||||
@@ -17,13 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.owasp.dependencycheck.data.update;
|
package org.owasp.dependencycheck.data.update;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.owasp.dependencycheck.BaseTest;
|
import org.owasp.dependencycheck.BaseTest;
|
||||||
import org.owasp.dependencycheck.data.update.exception.UpdateException;
|
|
||||||
import org.owasp.dependencycheck.data.update.nvd.UpdateableNvdCve;
|
import org.owasp.dependencycheck.data.update.nvd.UpdateableNvdCve;
|
||||||
import org.owasp.dependencycheck.utils.DownloadFailedException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -31,23 +28,23 @@ import org.owasp.dependencycheck.utils.DownloadFailedException;
|
|||||||
*/
|
*/
|
||||||
public class NvdCveUpdaterIntegrationTest extends BaseTest {
|
public class NvdCveUpdaterIntegrationTest extends BaseTest {
|
||||||
|
|
||||||
public NvdCveUpdater getUpdater() throws MalformedURLException, DownloadFailedException, UpdateException {
|
public NvdCveUpdater getUpdater() {
|
||||||
NvdCveUpdater instance = new NvdCveUpdater();
|
NvdCveUpdater instance = new NvdCveUpdater();
|
||||||
instance.initializeExecutorServices();
|
instance.initializeExecutorServices();
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// test removed as it is duplicative of the EngineIntegrationTest and the NvdCveUpdaterIntergraionTest
|
/**
|
||||||
// /**
|
* Test of update method.
|
||||||
// * Test of update method, of class StandardUpdate.
|
*/
|
||||||
// */
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdate() throws Exception {
|
public void testUpdate() throws Exception {
|
||||||
NvdCveUpdater instance = getUpdater();
|
NvdCveUpdater instance = getUpdater();
|
||||||
instance.update();
|
instance.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test of updatesNeeded method, of class StandardUpdate.
|
* Test of updatesNeeded method.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testUpdatesNeeded() throws Exception {
|
public void testUpdatesNeeded() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user