PDA

View Full Version : Java Bug


groenena
02-08-2010, 03:40 PM
I am using Hessian for Java 4.0.3. In the class SerializerFactory I see the following code for the method 'loadSerializer':

protected Serializer loadSerializer(Class cl)
throws HessianProtocolException
{
Serializer serializer = null;

for (int i = 0;
_factories != null && i < _factories.size();
i++) {
AbstractSerializerFactory factory;

factory = (AbstractSerializerFactory) _factories.get(i);

serializer = factory.getSerializer(cl);

if (serializer != null)
return serializer;
}

serializer = _contextFactory.getSerializer(cl.getName());

if (serializer != null)
return serializer;

When the 'for' loop finds a serializer it exits with that serializer. In the code for the method for the method 'loadDeserializer',
it finds the deserializer in its 'for' loop and doesn't exit with it. Is this a bug?

protected Deserializer loadDeserializer(Class cl)
throws HessianProtocolException
{
Deserializer deserializer = null;

for (int i = 0;
deserializer == null && _factories != null && i < _factories.size();
i++) {
AbstractSerializerFactory factory;
factory = (AbstractSerializerFactory) _factories.get(i);

deserializer = factory.getDeserializer(cl);
}

// XXX: need test
deserializer = _contextFactory.getDeserializer(cl.getName());

if (deserializer != null)
return deserializer;

I tried to add my own SerializerFactory and the deserializer is never found.

emil
02-16-2010, 08:45 PM
Hi groenena,

Looks like this was already reported as a bug:

http://bugs.caucho.com/view.php?id=3632

I'll try to take a look at it this week.

Thanks,
Emil

emil
02-16-2010, 10:28 PM
Actually, I just went ahead and fixed it. Should be resolved in Hessian 4.0.4.

Emil

occurneNock
07-11-2010, 08:06 PM
I have experienced a bug with java.io.FileWriter on P800. The flush method has no effect. The only way to get data written to a file is to close the FileWrite and open it if you want to write more to the file. Has anyone else experienced this?

mvh,
Markus