This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Suggested changes to Kawa
- From: Gerardo Horvilleur <magoghm at Prodigy dot net dot mx>
- To: 'Kawa List' <kawa at sources dot redhat dot com>
- Date: Wed, 29 Oct 2003 22:47:39 -0600
- Subject: Suggested changes to Kawa
- Reply-to: mago at mundojava dot com
Hi,
I've been using Kawa to develop a Web application which uses Prevayler
(http://www.prevayler.org) as a persistence mechanism. To make it work I
had to make a few small changes to the Kawa source code.
The problems and fixes are:
1. If you serialize a Kawa list then you can't read it back into memory
again.
There are two cases:
a) If you serialize a gnu.lists.PairWithPosition then you can't
deserialize it again because it doesn't have an empty constructor.
Adding the empty constructor to PairWithPosition solves the problem.
b) If you serialize a list then when you deserialize it you always get
an empty list. To fix this I changed the readResolve() method in
gnu.lists.LList from this:
-----------------------------------------------------------
public Object readResolve() throws ObjectStreamException
{
return Empty;
}
-----------------------------------------------------------
to this:
--------------------------------------------------------
public Object readResolve() throws ObjectStreamException
{
if (size() == 0)
return Empty;
else
return this;
}
---------------------------------------------------------
2. If you compile a Kawa source as a servlet it doesn't handle a HTTP
POST requests.
To fix this I just added this method to gnu.kawa.servlet.KawaServlet:
------------------------------------------------------------------------
----------
public void doPost(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
doGet(request, response);
}
------------------------------------------------------------------------
----------
3. When you serialize a Kawa symbol (which is just an interned
java.lang.String) and then deserialize it, the deserialized symbol is
not interned. This means you can't use eq? to compare deserialized
symbols. I don't have a fix for this yet...