[freenet-cvs] r20931 - branches/db4o/freenet/src/freenet/node

toad at freenetproject.org toad at freenetproject.org
Wed Jul 2 16:03:20 UTC 2008


Author: toad
Date: 2008-07-02 16:03:20 +0000 (Wed, 02 Jul 2008)
New Revision: 20931

Modified:
   branches/db4o/freenet/src/freenet/node/SendableRequest.java
Log:
SendableRequest must have a persistent hashCode.

Modified: branches/db4o/freenet/src/freenet/node/SendableRequest.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/SendableRequest.java	2008-07-02 15:58:37 UTC (rev 20930)
+++ branches/db4o/freenet/src/freenet/node/SendableRequest.java	2008-07-02 16:03:20 UTC (rev 20931)
@@ -18,10 +18,18 @@
  */
 public abstract class SendableRequest implements RandomGrabArrayItem {
 	
+	// Since we put these into Set's etc, hashCode must be persistent.
+	private final int hashCode;
+	
 	SendableRequest(boolean persistent) {
 		this.persistent = persistent;
+		this.hashCode = super.hashCode();
 	}
 	
+	public final int hashCode() {
+		return hashCode;
+	}
+	
 	protected RandomGrabArray parentGrabArray;
 	/** Member because must be accessible when only marginally activated */
 	protected final boolean persistent;




More information about the cvs mailing list