cziegeler 02/05/28 06:16:31
Modified: src/java/org/apache/cocoon/caching ComponentCacheKey.java
PipelineCacheKey.java
Log:
Make hashCode odd as suggested by Berin
Revision Changes Path
1.11 +6 -6
xml-cocoon2/src/java/org/apache/cocoon/caching/ComponentCacheKey.java
Index: ComponentCacheKey.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/caching/ComponentCacheKey.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ComponentCacheKey.java 28 May 2002 12:00:56 -0000 1.10
+++ ComponentCacheKey.java 28 May 2002 13:16:31 -0000 1.11
@@ -61,15 +61,15 @@
* is unique inside the components space.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Id: ComponentCacheKey.java,v 1.10 2002/05/28 12:00:56 cziegeler
Exp $
+ * @version CVS $Id: ComponentCacheKey.java,v 1.11 2002/05/28 13:16:31 cziegeler
Exp $
*/
public final class ComponentCacheKey
implements Serializable {
public static final int ComponentType_Generator = 1;
- public static final int ComponentType_Transformer = 2;
- public static final int ComponentType_Serializer = 3;
- public static final int ComponentType_Reader = 4;
+ public static final int ComponentType_Transformer = 3;
+ public static final int ComponentType_Serializer = 5;
+ public static final int ComponentType_Reader = 7;
/** The component type */
private int type;
@@ -114,8 +114,8 @@
// FIXME - this is not very safe
if (this.hashCode == 0) {
this.hashCode = this.type +
- (this.identifier.length() << 2) +
- (this.key.hashCode() << 6);
+ (this.identifier.length() << 3) +
+ (this.key.hashCode() << 10);
}
return this.hashCode;
}
1.13 +2 -1
xml-cocoon2/src/java/org/apache/cocoon/caching/PipelineCacheKey.java
Index: PipelineCacheKey.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/caching/PipelineCacheKey.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- PipelineCacheKey.java 28 May 2002 12:00:56 -0000 1.12
+++ PipelineCacheKey.java 28 May 2002 13:16:31 -0000 1.13
@@ -58,7 +58,7 @@
* or more {@link ComponentCacheKey}s.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Id: PipelineCacheKey.java,v 1.12 2002/05/28 12:00:56 cziegeler Exp
$
+ * @version CVS $Id: PipelineCacheKey.java,v 1.13 2002/05/28 13:16:31 cziegeler Exp
$
*/
public final class PipelineCacheKey
implements java.io.Serializable {
@@ -130,6 +130,7 @@
for(int i=0; i < this.keys.size(); i++) {
this.hashCode = this.keys.get(i).hashCode();
}
+ if (this.keys.size() % 2 == 0) this.hashCode++;
}
return this.hashCode;
}
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]