classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cp-patches] FYI: Fix serialization of Class objects


From: Mark Wielaard
Subject: RE: [cp-patches] FYI: Fix serialization of Class objects
Date: Thu, 20 Jan 2005 12:37:10 +0100

Hi,

On Thu, 2005-01-20 at 09:38 +0100, Jeroen Frijters wrote:
> So yes, it is allowed to have class named "int", it would, however, not
> surprise me if you'd run into various problems with the reflection
> and/or serialization libraries with such a class.
> 
> BTW, I didn't really look at Mark's patch (or rather, I did but I didn't
> take enough time to understand it), but I just tried it and it appears
> to work fine for a class named "int".

Yes, that probably will/should work. But as soon as you mix the class
"int" from the unnamed package with trying to (de)serialize the
primitive type class of 'int' things will break. I don't think there is
any way around that since the class names in a serialized stream are
just names, not type descriptors. You could perhaps try to back up when
you notice a type conflict and retry with the int.class. But the current
Object stream classes are a bit hairy and you would have to be very
careful when you rewrite them.

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]