2005-08-01 duck

* Fix an addressbook NPE when a new hostname from the master addressbook
      didn't exist in the router addressbook.
    * Fix an addressbook bug which caused subscriptions not to be parsed at
      all. (Oops!)
This commit is contained in:
duck
2005-08-01 13:34:10 +00:00
committed by zzz
parent 03bba51c1e
commit 7227cae6ef

View File

@ -73,7 +73,7 @@ public class AddressBook {
null); null);
get.fetch(); get.fetch();
try { try {
this.addresses = ConfigParser.parse("addressbook.tmp"); this.addresses = ConfigParser.parse(new File("addressbook.tmp"));
} catch (IOException exp) { } catch (IOException exp) {
this.addresses = new HashMap(); this.addresses = new HashMap();
} }
@ -96,7 +96,7 @@ public class AddressBook {
get.fetch(); get.fetch();
subscription.setEtag(get.getETag()); subscription.setEtag(get.getETag());
try { try {
this.addresses = ConfigParser.parse("addressbook.tmp"); this.addresses = ConfigParser.parse(new File("addressbook.tmp"));
} catch (IOException exp) { } catch (IOException exp) {
this.addresses = new HashMap(); this.addresses = new HashMap();
} }
@ -178,14 +178,13 @@ public class AddressBook {
+ ". Destination in remote address book is " + ". Destination in remote address book is "
+ otherValue); + otherValue);
} }
} else { } else if (!this.addresses.containsKey(otherKey)
if (!this.addresses.get(otherKey).equals(otherValue)) { || !this.addresses.get(otherKey).equals(otherValue)) {
this.addresses.put(otherKey, otherValue); this.addresses.put(otherKey, otherValue);
this.modified = true; this.modified = true;
if (log != null) { if (log != null) {
log.append("New address " + otherKey log.append("New address " + otherKey
+ " added to address book."); + " added to address book.");
}
} }
} }
} }