[freenet-cvs] r15465 - trunk/freenet/src/freenet/io/comm

toad at freenetproject.org toad at freenetproject.org
Sat Oct 20 22:49:34 UTC 2007


Author: toad
Date: 2007-10-20 22:49:34 +0000 (Sat, 20 Oct 2007)
New Revision: 15465

Modified:
   trunk/freenet/src/freenet/io/comm/FreenetInetAddress.java
Log:
explain hashCode() logic

Modified: trunk/freenet/src/freenet/io/comm/FreenetInetAddress.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/FreenetInetAddress.java	2007-10-20 22:38:22 UTC (rev 15464)
+++ trunk/freenet/src/freenet/io/comm/FreenetInetAddress.java	2007-10-20 22:49:34 UTC (rev 15465)
@@ -301,9 +301,9 @@
 
 	public int hashCode() {
 		if(hostname != null) {
-			return hostname.hashCode();
+			return hostname.hashCode(); // Was set at creation, so it can safely be used here.
 		} else {
-			return _address.hashCode();
+			return _address.hashCode(); // Can be null, but if so, hostname will be non-null.
 		}
 	}
 	




More information about the cvs mailing list