abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r443094 - /incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/cache/SimpleCacheKey.java
Date Wed, 13 Sep 2006 19:44:36 GMT
Author: jmsnell
Date: Wed Sep 13 12:44:35 2006
New Revision: 443094

URL: http://svn.apache.org/viewvc?view=rev&rev=443094
Log:
BUG: java.util.Arrays.hashCode(...) is not supported under JDK 1.4.2 and retroweaver does
not migrate it.

Modified:
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/cache/SimpleCacheKey.java

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/cache/SimpleCacheKey.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/cache/SimpleCacheKey.java?view=diff&rev=443094&r1=443093&r2=443094
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/cache/SimpleCacheKey.java
(original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/cache/SimpleCacheKey.java
Wed Sep 13 12:44:35 2006
@@ -18,7 +18,6 @@
 package org.apache.abdera.protocol.client.cache;
 
 import java.security.MessageDigest;
-import java.util.Arrays;
 
 /**
  * Simple cache key based on an md5 hash of the URI.
@@ -55,7 +54,12 @@
   
   @Override
   public int hashCode() {
-    return 31 + Arrays.hashCode(key);
+    if (key == null) return 0;
+    int result = 1;
+    for (byte element : key) {
+      result = 31 * result + element;
+    }
+    return result;
   }
 
 }



Mime
View raw message