checkstyle corrections

Former-commit-id: 784b14351589b8d4184e931a2b9bf680af2a7283
This commit is contained in:
Jeremy Long
2013-10-08 20:59:30 -04:00
parent 6b291a5ce5
commit 10faef62fa
5 changed files with 17 additions and 6 deletions

View File

@@ -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);

View File

@@ -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.

View File

@@ -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.
*

View File

@@ -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

View File

@@ -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());
}
}