On 28 Jun 2000, Brian Jones wrote:

> Thanks for the info, I wanted to send a small patch concerning this
> class against libgcj's implementation but for some reason anoncvs is
> broken this morning (can't update or do a diff), and I already removed
> the original...  Anyway, in ObjectStreamClass.lookup (Class) it should
> look something like this with the check for serialization moved to
> somewhere more appropriate to match the comments and Sun's own docs.
> 
>   public static ObjectStreamClass lookup (Class cl)
>   {
>     if (cl == null)
>       return null;
>     if (! (Serializable.class).isAssignableFrom (cl))
>       return null;
> 
>     ObjectStreamClass osc = (ObjectStreamClass)classLookupTable.get (cl);
> 
>     if (osc != null)
>       return osc;
>     else
>     {
>       osc = new ObjectStreamClass (cl);
>       classLookupTable.put (cl, osc);
>       return osc;
>     }
>   }

Hmm, it looks to me like libgcj is using the same code for lookup as
classpath is (and has used for quite a while).  Is this a change you think
applies to classpath also or did you think it was libgcj-specific?

Maybe I'm missing something, but the above looks functionally identical to
what exists in libgcj except (like in the current classpath version) the
check for isAssignableFrom happens before the call to classLookupTable.get
(which is an efficiency improvement).

Am I diffing against a different version than you're looking at?
--warrenl

Reply via email to