more generics

This commit is contained in:
zzz
2011-03-11 02:18:15 +00:00
parent b048b016ad
commit f4e92572eb
2 changed files with 5 additions and 8 deletions

View File

@ -24,7 +24,6 @@ package net.i2p.addressbook;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import net.i2p.I2PAppContext;
@ -218,11 +217,9 @@ class AddressBook {
* The log to write messages about new addresses or conflicts to.
*/
public void merge(AddressBook other, boolean overwrite, Log log) {
Iterator otherIter = other.addresses.keySet().iterator();
while (otherIter.hasNext()) {
String otherKey = (String) otherIter.next();
String otherValue = (String) other.addresses.get(otherKey);
for (Map.Entry<String, String> entry : other.addresses.entrySet()) {
String otherKey = entry.getKey();
String otherValue = entry.getValue();
if (valid(otherKey, otherValue)) {
if (this.addresses.containsKey(otherKey) && !overwrite) {

View File

@ -64,10 +64,10 @@ public class Daemon {
public void update(AddressBook master, AddressBook router,
File published, SubscriptionList subscriptions, Log log) {
router.merge(master, true, null);
Iterator iter = subscriptions.iterator();
Iterator<AddressBook> iter = subscriptions.iterator();
while (iter.hasNext()) {
// yes, the EepGet fetch() is done in next()
router.merge((AddressBook) iter.next(), false, log);
router.merge(iter.next(), false, log);
}
router.write();
if (published != null)