From: David ‘Bombe’ Roden Date: Fri, 16 May 2008 15:12:09 +0000 (+0000) Subject: use comparer X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d25f54965e42ad0ab1aedd1fdc3243c41731f718;p=jSite2.git use comparer git-svn-id: http://trooper/svn/projects/jSite/trunk@898 c3eda9e8-030b-0410-8277-bc7414b0a119 --- diff --git a/src/net/pterodactylus/jsite/core/Node.java b/src/net/pterodactylus/jsite/core/Node.java index 7751225..2058d99 100644 --- a/src/net/pterodactylus/jsite/core/Node.java +++ b/src/net/pterodactylus/jsite/core/Node.java @@ -25,6 +25,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import net.pterodactylus.util.beans.Comparer; + /** * Container for a Freenet node. A Node is capable of notifying * {@link PropertyChangeListener}s if any of the contained properties change. @@ -119,7 +121,7 @@ public class Node { public void setName(String name) { String oldName = this.name; this.name = name; - if (((oldName != null) && (name == null)) || ((oldName == null) && (name != null)) || ((name != null) && !name.equals(oldName))) { + if (!Comparer.equal(oldName, name)) { firePropertyChange(PROPERTY_NAME, oldName, name); } } @@ -142,7 +144,7 @@ public class Node { public void setHostname(String hostname) { String oldHostname = this.hostname; this.hostname = hostname; - if (((oldHostname != null) && (hostname == null)) || ((oldHostname == null) && (hostname != null)) || ((hostname != null) && !hostname.equals(oldHostname))) { + if (!Comparer.equal(oldHostname, hostname)) { firePropertyChange(PROPERTY_HOSTNAME, oldHostname, hostname); } }