mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-21 08:39:24 +01:00
checkstyle corrections
Former-commit-id: 784b14351589b8d4184e931a2b9bf680af2a7283
This commit is contained in:
@@ -276,7 +276,7 @@ public class StandardUpdateTask extends AbstractUpdateTask {
|
|||||||
private Updateable retrieveCurrentTimestampsFromWeb()
|
private Updateable retrieveCurrentTimestampsFromWeb()
|
||||||
throws MalformedURLException, DownloadFailedException, InvalidDataException, InvalidSettingException {
|
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),
|
updates.add(MODIFIED, Settings.getString(Settings.KEYS.CVE_MODIFIED_20_URL),
|
||||||
Settings.getString(Settings.KEYS.CVE_MODIFIED_12_URL),
|
Settings.getString(Settings.KEYS.CVE_MODIFIED_12_URL),
|
||||||
false);
|
false);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import org.owasp.dependencycheck.utils.DownloadFailedException;
|
|||||||
*
|
*
|
||||||
* @author Jeremy Long (jeremy.long@owasp.org)
|
* @author Jeremy Long (jeremy.long@owasp.org)
|
||||||
*/
|
*/
|
||||||
public class UpdateTaskFactory {
|
public final class UpdateTaskFactory {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* private constructor for a utility class.
|
* 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>();
|
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.
|
* 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
|
* A listing of domain parts that shold not be used as evidence. Yes, this
|
||||||
* is an incomplete list.
|
* 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
|
* <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();
|
String url = "file:///" + f.getCanonicalPath();
|
||||||
Updateable instance = new Updateable();
|
Updateable instance = new Updateable();
|
||||||
instance.add(id, url, url, false);
|
instance.add(id, url, url, false);
|
||||||
assertFalse(instance.collection.isEmpty());
|
assertFalse(instance.getCollection().isEmpty());
|
||||||
instance.clear();
|
instance.clear();
|
||||||
assertTrue(instance.collection.isEmpty());
|
assertTrue(instance.getCollection().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -155,6 +155,6 @@ public class UpdateableTest {
|
|||||||
itemsProcessed += 1;
|
itemsProcessed += 1;
|
||||||
}
|
}
|
||||||
assertEquals(3, itemsProcessed);
|
assertEquals(3, itemsProcessed);
|
||||||
assertEquals(2, instance.collection.size());
|
assertEquals(2, instance.getCollection().size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user