Author: toad
Date: 2008-07-10 19:54:24 +0000 (Thu, 10 Jul 2008)
New Revision: 21036
Modified:
branches/db4o/freenet/src/freenet/client/async/PersistentChosenRequest.java
Log:
Fix an NPE related to inserts
Modified:
branches/db4o/freenet/src/freenet/client/async/PersistentChosenRequest.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/PersistentChosenRequest.java
2008-07-10 19:41:33 UTC (rev 21035)
+++ branches/db4o/freenet/src/freenet/client/async/PersistentChosenRequest.java
2008-07-10 19:54:24 UTC (rev 21036)
@@ -29,7 +29,14 @@
PersistentChosenRequest(ClientRequestSchedulerCore core,
SendableRequest req, Object tok, Key key, ClientKey ckey, short prio) {
super(req, tok, key, ckey, prio);
if(tok == null) throw new NullPointerException();
- hashCode = core.hashCode() ^ req.hashCode() ^ key.hashCode() ^
ckey.hashCode() ^ tok.hashCode();
+ int hash = core.hashCode() ^ req.hashCode();
+ if(key != null)
+ hash ^= key.hashCode();
+ if(ckey != null)
+ hash ^= ckey.hashCode();
+ if(tok != null)
+ hash ^= tok.hashCode();
+ hashCode = hash;
this.core = core;
}