mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 07:43:40 +01:00
checkstyle corrections
Former-commit-id: 48181a5325e8154dc2f5835badfd1d2d7ad2104f
This commit is contained in:
@@ -276,7 +276,7 @@ public class StandardUpdateTask extends AbstractUpdateTask {
|
||||
private Updateable retrieveCurrentTimestampsFromWeb()
|
||||
throws MalformedURLException, DownloadFailedException, InvalidDataException, InvalidSettingException {
|
||||
|
||||
Updateable updates = new Updateable();
|
||||
final Updateable updates = new Updateable();
|
||||
updates.add(MODIFIED, Settings.getString(Settings.KEYS.CVE_MODIFIED_20_URL),
|
||||
Settings.getString(Settings.KEYS.CVE_MODIFIED_12_URL),
|
||||
false);
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.owasp.dependencycheck.utils.DownloadFailedException;
|
||||
*
|
||||
* @author Jeremy Long (jeremy.long@owasp.org)
|
||||
*/
|
||||
public class UpdateTaskFactory {
|
||||
public final class UpdateTaskFactory {
|
||||
|
||||
/**
|
||||
* private constructor for a utility class.
|
||||
|
||||
@@ -40,6 +40,16 @@ public class Updateable implements java.lang.Iterable<NvdCveInfo>, Iterator<NvdC
|
||||
*/
|
||||
private Map<String, NvdCveInfo> collection = new TreeMap<String, NvdCveInfo>();
|
||||
|
||||
/**
|
||||
* Returns the collection of NvdCveInfo objects. This method is mainly used
|
||||
* for testing.
|
||||
*
|
||||
* @return the collection of NvdCveInfo objects
|
||||
*/
|
||||
protected Map<String, NvdCveInfo> getCollection() {
|
||||
return collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether or not an update is needed.
|
||||
*
|
||||
|
||||
@@ -70,7 +70,8 @@ public final class UrlStringUtils {
|
||||
* A listing of domain parts that shold not be used as evidence. Yes, this
|
||||
* is an incomplete list.
|
||||
*/
|
||||
private static final HashSet<String> IGNORE_LIST = new HashSet<String>(Arrays.asList("www", "com", "org", "gov", "info", "name", "net", "pro", "tel", "mobi", "xxx"));
|
||||
private static final HashSet<String> IGNORE_LIST = new HashSet<String>(
|
||||
Arrays.asList("www", "com", "org", "gov", "info", "name", "net", "pro", "tel", "mobi", "xxx"));
|
||||
|
||||
/**
|
||||
* <p>Takes a URL, in String format, and adds the important parts of the URL
|
||||
|
||||
@@ -130,9 +130,9 @@ public class UpdateableTest {
|
||||
String url = "file:///" + f.getCanonicalPath();
|
||||
Updateable instance = new Updateable();
|
||||
instance.add(id, url, url, false);
|
||||
assertFalse(instance.collection.isEmpty());
|
||||
assertFalse(instance.getCollection().isEmpty());
|
||||
instance.clear();
|
||||
assertTrue(instance.collection.isEmpty());
|
||||
assertTrue(instance.getCollection().isEmpty());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,6 +155,6 @@ public class UpdateableTest {
|
||||
itemsProcessed += 1;
|
||||
}
|
||||
assertEquals(3, itemsProcessed);
|
||||
assertEquals(2, instance.collection.size());
|
||||
assertEquals(2, instance.getCollection().size());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user