You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/09/27 09:24:15 UTC
DO NOT REPLY [Bug 31433] New: -
CircularFifoBuffer not really Serializable
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31433>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=31433
CircularFifoBuffer not really Serializable
Summary: CircularFifoBuffer not really Serializable
Product: Commons
Version: 3.1
Platform: Sun
OS/Version: Solaris
Status: NEW
Severity: Normal
Priority: Other
Component: Collections
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: kalle.gustafsson@compingo.se
Create a CircularFifoBuffer of size N. Serialize and deserialize a couple of
times. When adding element N+1, an error occurs. (OutOfMemoryError in our
testing environment, ArrayIndexOutOfBounds when running the code snippet.)
The error can be reproduced by running the following code snippet in a scrapbook
page in WebSphere Studio 5.1.2 (default JRE) on Windows XP (The error occurs at
the third add operation):
org.apache.commons.collections.buffer.CircularFifoBuffer b = new
org.apache.commons.collections.buffer.CircularFifoBuffer(2);
b.add("a");
java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();
new java.io.ObjectOutputStream(bos).writeObject(b);
org.apache.commons.collections.buffer.CircularFifoBuffer b2 =
(org.apache.commons.collections.buffer.CircularFifoBuffer) new
java.io.ObjectInputStream(new
java.io.ByteArrayInputStream(bos.toByteArray())).readObject();
b2.add("b");
bos = new java.io.ByteArrayOutputStream();
new java.io.ObjectOutputStream(bos).writeObject(b2);
b = (org.apache.commons.collections.buffer.CircularFifoBuffer) new
java.io.ObjectInputStream(new
java.io.ByteArrayInputStream(bos.toByteArray())).readObject();
b.add("c");
bos = new java.io.ByteArrayOutputStream();
new java.io.ObjectOutputStream(bos).writeObject(b);
b2 = (org.apache.commons.collections.buffer.CircularFifoBuffer) new
java.io.ObjectInputStream(new
java.io.ByteArrayInputStream(bos.toByteArray())).readObject();
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org