[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/collection ...
Ben Wang
bwang at jboss.com
Thu Nov 9 11:53:28 EST 2006
User: bwang
Date: 06/11/09 11:53:28
Modified: src-50/org/jboss/cache/pojo/collection CachedListImpl.java
Log:
Added detection for Collection hashCode recursion.
Revision Changes Path
1.12 +19 -4 JBossCache/src-50/org/jboss/cache/pojo/collection/CachedListImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CachedListImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/collection/CachedListImpl.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- CachedListImpl.java 6 Nov 2006 23:32:16 -0000 1.11
+++ CachedListImpl.java 9 Nov 2006 16:53:28 -0000 1.12
@@ -16,6 +16,8 @@
import org.jboss.cache.pojo.PojoTreeCache;
import org.jboss.cache.pojo.impl.PojoCacheImpl;
import org.jboss.cache.pojo.interceptors.dynamic.AbstractCollectionInterceptor;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import java.util.Iterator;
import java.util.LinkedList;
@@ -24,6 +26,8 @@
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Collection;
+import java.util.ArrayList;
+import java.io.ObjectStreamException;
/**
* List implementation that uses cache as a backend store.
@@ -31,11 +35,9 @@
* @author Ben Wang
* @author Scott Marlow
*/
-public class CachedListImpl extends CachedListAbstract implements List
+public class CachedListImpl extends CachedListAbstract
{
-
-// protected static final Log log_ = LogFactory.getLog(CachedListImpl.class);
- @SuppressWarnings({"CanBeFinal"})
+ private static Log log_ = LogFactory.getLog(CachedListImpl.class.getName());
private CacheSPI cache_;
private PojoCacheImpl pCache_;
private AbstractCollectionInterceptor interceptor_;
@@ -64,6 +66,19 @@
}
}
+ /** Serialize a normal ArrayList
+ *
+ */
+ private Object XwriteReplace() throws ObjectStreamException
+ {
+ log_.warn("writeReplace(): this calss is not suppored to be serialized." +
+ " Will substitue with a normal ArryList");
+
+ ArrayList toSerialize = new ArrayList();
+ toSerialize.addAll(this);
+ return toSerialize;
+ }
+
public Object get(int index)
{
checkIndex();
More information about the jboss-cvs-commits
mailing list