You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/06/10 20:35:00 UTC

[jira] [Commented] (WICKET-6560) Improve serialization warnings in ChainingModel

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

ASF subversion and git services commented on WICKET-6560:
---------------------------------------------------------

Commit 950403d5ccea5643e6005450c6b808ea72079d59 in wicket's branch refs/heads/master from [~svenmeier]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=950403d ]

WICKET-6560 no warning for null


> Improve serialization warnings in ChainingModel
> -----------------------------------------------
>
>                 Key: WICKET-6560
>                 URL: https://issues.apache.org/jira/browse/WICKET-6560
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 8.0.0
>            Reporter: Thomas Heigl
>            Priority: Major
>
> After porting our app to Wicket 8, I'm getting these warnings on my test environment:
> {code:java}
> WAR o.a.w.model.ChainingModel It is not a good idea to reference a non-serializable instance in models directly as it may lead to serialization problems{code}
> The warning is OK, but it gives me absolutely no hint where to look for the issue. Could you please add the (simple) class name of the model object to the warning message? Currently, the only way for me to find these issues is with a breakpoint in `ChainingModel` and clicking through my application until I hit the warning.
>   
>  Also the warning is logged for `null` objects, which probably shouldn't happen. 
> {code:java}
> public ChainingModel(final Object modelObject)
> {
>     if (modelObject instanceof Session)   
>     {    
>         LOG.warn("It is not a good idea to reference the .........");
>     }
>     else if (modelObject instanceof Serializable == false)
>     {         
>         LOG.warn("It is not a good idea to reference a non-serializable instance ....");     
>     }
>     target = modelObject;
> }{code}
>  
>  It should read something like:
> {code:java}
> if (modelObject != null && modelObject instanceof Serializable == false){code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)