[ 
https://issues.apache.org/jira/browse/WICKET-6166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15294985#comment-15294985
 ] 

Martin Grigorov commented on WICKET-6166:
-----------------------------------------

I am hesitant to do any changes here.
WicketObjects.sizeof() detaches the passed Component but only after making a 
clone of it. If we detach the original page then many other things might break, 
e.g. see WICKET-4867.
I'd recommend you to use custom component, e.g. Label, that detaches the page 
before passing it to WicketObjects.sizeof() if this doesn't break your 
application.

> JavaSerializer using CheckingObjectOutputStream fails in conjunction with 
> PageSizeDebugPanel
> --------------------------------------------------------------------------------------------
>
>                 Key: WICKET-6166
>                 URL: https://issues.apache.org/jira/browse/WICKET-6166
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 7.2.0
>            Reporter: Michael Day
>            Priority: Minor
>
> I've overridden JavaSerializer in the following way.  When my application is 
> in development mode, the PageSizeDebugPanel attempts to serialize my 
> components to calculate their size.  Unfortunately it does this before 
> detach() has been called, so of course the NotDetachedModelChecker() fails.
> {code}
> JavaSerializer serializer = new JavaSerializer(getApplicationKey()) {
>     @Override
>     protected ObjectOutputStream newObjectOutputStream(OutputStream out) 
> throws IOException {
>         List<IObjectChecker> checkers = Lists.newArrayList(
>                 new NotDetachedModelChecker(),
>                 new ObjectSerializationChecker());
>         return new CheckingObjectOutputStream(out, checkers.toArray(new 
> IObjectChecker[checkers.size()]));
>     }
> };
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to