You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Damien Hollis (JIRA)" <ji...@apache.org> on 2013/05/03 06:08:18 UTC

[jira] [Updated] (WICKET-5176) StringResourceModel doesn't detach model in some cases

     [ https://issues.apache.org/jira/browse/WICKET-5176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Damien Hollis updated WICKET-5176:
----------------------------------

    Attachment: Main.java

Attached is a very small test program that shows the issue.  
                
> StringResourceModel doesn't detach model in some cases
> ------------------------------------------------------
>
>                 Key: WICKET-5176
>                 URL: https://issues.apache.org/jira/browse/WICKET-5176
>             Project: Wicket
>          Issue Type: Bug
>            Reporter: Damien Hollis
>            Priority: Minor
>         Attachments: Main.java
>
>
> We have come across an issue with StringResourceModel not detaching the model it holds under a certain condition.  The problem is the case where the StringResourceModel is created but it is not used - for example when it is on a tab that is not displayed.
> StringResourceModel is a subclass of LoadableDetachableModel and it simply implements onDetach(), letting the superclass decide whether it is attached or not. The problem is that when StringResourceModel is created, LoadableDetachableModel.attached will be false.  If the StringResourceModel is never read (i.e. getObject() is not called) the LoadableDetachableModel will not be marked as attached and when detach() is called, onDetach() will not be called.  Therefore StringResourceModel will not call detach() on the model that it holds.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira