You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Emond Papegaaij <em...@topicus.nl> on 2011/01/25 14:06:06 UTC

Strange writeObjectMethodCache in SerializableChecker

Hi all,

At Topicus, we maintain a customized SerializableChecker with some additional 
checks. I was trying to fix some generics-warnings and noticed a strange thing 
about the writeObjectMethodCache. This variable is used in only 4 places, one 
is a clear, one a get and 2 are puts. Both puts take a Boolean as value, but 
the get checks if the value returned is a Method, which obviously can never 
happen. I think the 'writeObjectMethod' should be put into the map after line 
473:

	writeObjectMethod = cls.getDeclaredMethod("writeObject",
			new Class[] { java.io.ObjectOutputStream.class });

Best regards,
Emond

Re: Strange writeObjectMethodCache in SerializableChecker

Posted by Emond Papegaaij <em...@topicus.nl>.
Done: https://issues.apache.org/jira/browse/WICKET-3383

We extended the checker with checks for entities and attached LDMs, to prevent 
Hibernate sessions to leak through to the next request. I've also stripped the 
object paths to the bare minimum, which improves performace quite a bit. For 
large pages (with 1000s of objects in lists), the checker spends most of its 
time creating strings in statements like 'String arrayPos = "[" + i + "]";'. I 
don't think these changes are very usefull for other people.

Emond

On Tuesday 25 January 2011 14:17:06 Martin Grigorov wrote:
> File a ticket + patch ;-)
> 
> What else do you have in this custom SerializableChecker ? Maybe it is
> something that other users may benefit from and it can be included in the
> standard SerializableChecker and you'll not have to maintain it.
> 
> On Tue, Jan 25, 2011 at 2:06 PM, Emond Papegaaij
> <emond.papegaaij@topicus.nl
> 
> > wrote:
> > 
> > Hi all,
> > 
> > At Topicus, we maintain a customized SerializableChecker with some
> > additional
> > checks. I was trying to fix some generics-warnings and noticed a strange
> > thing
> > about the writeObjectMethodCache. This variable is used in only 4 places,
> > one
> > is a clear, one a get and 2 are puts. Both puts take a Boolean as value,
> > but
> > the get checks if the value returned is a Method, which obviously can
> > never happen. I think the 'writeObjectMethod' should be put into the map
> > after line
> > 
> > 473:
> >        writeObjectMethod = cls.getDeclaredMethod("writeObject",
> >        
> >                        new Class[] { java.io.ObjectOutputStream.class });
> > 
> > Best regards,
> > Emond

Re: Strange writeObjectMethodCache in SerializableChecker

Posted by Martin Grigorov <mg...@apache.org>.
File a ticket + patch ;-)

What else do you have in this custom SerializableChecker ? Maybe it is
something that other users may benefit from and it can be included in the
standard SerializableChecker and you'll not have to maintain it.

On Tue, Jan 25, 2011 at 2:06 PM, Emond Papegaaij <emond.papegaaij@topicus.nl
> wrote:

> Hi all,
>
> At Topicus, we maintain a customized SerializableChecker with some
> additional
> checks. I was trying to fix some generics-warnings and noticed a strange
> thing
> about the writeObjectMethodCache. This variable is used in only 4 places,
> one
> is a clear, one a get and 2 are puts. Both puts take a Boolean as value,
> but
> the get checks if the value returned is a Method, which obviously can never
> happen. I think the 'writeObjectMethod' should be put into the map after
> line
> 473:
>
>        writeObjectMethod = cls.getDeclaredMethod("writeObject",
>                        new Class[] { java.io.ObjectOutputStream.class });
>
> Best regards,
> Emond
>