Hi Martin,

I really like this idea. At Topicus we had to copy-paste the entire thing to 
make it check for subclasses of 'Entiteit' (our entity base class). It also 
checks for LDMs that are still attached, because these are not catched by the 
current checker, because the object is stored in a transient field. We also 
skip classes that are @Deprecated.

Best regards,
Emond

On Tuesday 25 January 2011 16:31:03 Martin Grigorov wrote:
> Hi,
> 
> Someone just asked in ##wicket something like: "for some reason my entity
> is serialized. it is wrapped in LDM, but still something went wrong and
> instead just the entity id, the whole entity is serialized"
> 
> https://gist.github.com/795052
> 
> Here are suggest introducing an annotation which serves like JSR-305's
> @NotNill - @WicketDontSerialize.
> I.e. if an object which class is annotated with this marker is sent to
> SerializableChecker#check() then throw an exception with the nice path to
> the object saying "this class may be Serializable but it shouldn't be
> serialized".
> This way hopefully the user will see when there is a leak reference which
> ties the object in the serialization.
> 
> Writing this email I realize that we can make it even better by extending
> the checker to use pluggable sub-checkers: checker for "implements
> Serializable", checker based on an annotation, based on a black/white list,
> or some other logic. This way the user app can pass a checker that
> disallows classes coming from third party libs (i.e. cannot be annotated).
> In DEV mode it can be replaced with no-op checker.
> 
> What do you think ?
> 
> martin-g

Reply via email to