Changeset f4e9257


Ignore:
Timestamp:
Mar 11, 2011 2:18:15 AM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
8b737b4
Parents:
b048b01
Message:

more generics

Location:
apps/addressbook/java/src/net/i2p/addressbook
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/addressbook/java/src/net/i2p/addressbook/AddressBook.java

    rb048b01 rf4e9257  
    2525import java.io.IOException;
    2626import java.util.HashMap;
    27 import java.util.Iterator;
    2827import java.util.Map;
    2928
     
    219218     */
    220219    public void merge(AddressBook other, boolean overwrite, Log log) {
    221         Iterator otherIter = other.addresses.keySet().iterator();
    222 
    223         while (otherIter.hasNext()) {
    224             String otherKey = (String) otherIter.next();
    225             String otherValue = (String) other.addresses.get(otherKey);
     220        for (Map.Entry<String, String> entry : other.addresses.entrySet()) {
     221            String otherKey = entry.getKey();
     222            String otherValue = entry.getValue();
    226223
    227224            if (valid(otherKey, otherValue)) {
  • apps/addressbook/java/src/net/i2p/addressbook/Daemon.java

    rb048b01 rf4e9257  
    6565            File published, SubscriptionList subscriptions, Log log) {
    6666        router.merge(master, true, null);
    67         Iterator iter = subscriptions.iterator();
     67        Iterator<AddressBook> iter = subscriptions.iterator();
    6868        while (iter.hasNext()) {
    6969            // yes, the EepGet fetch() is done in next()
    70             router.merge((AddressBook) iter.next(), false, log);
     70            router.merge(iter.next(), false, log);
    7171        }
    7272        router.write();
Note: See TracChangeset for help on using the changeset viewer.