You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Jan Riehn (JIRA)" <ji...@apache.org> on 2012/05/03 17:26:51 UTC

[jira] [Created] (WICKET-4530) Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator

Jan Riehn created WICKET-4530:
---------------------------------

             Summary: Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator
                 Key: WICKET-4530
                 URL: https://issues.apache.org/jira/browse/WICKET-4530
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 6.0.0-beta1, 1.5.5
            Reporter: Jan Riehn


IResourceStreamLocator contains the method newResourceNameIterator(...) which builds a ResourceNameIterator. Unfortunately ResourceNameIterator declares several getter methods (getLocale(), getStyle(), getVariation(), getExtension()) as final and thus ties the public API to the internal implementation of ResourceNameIterator. Therefore it's not possible to fully customize the behavior of ResourceNameIterator by subclassing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4530) Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator

Posted by "Christian Oldiges (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13269580#comment-13269580 ] 

Christian Oldiges commented on WICKET-4530:
-------------------------------------------

Basic rule: 

The getter methods have to return the current values depending on the state of the iterator. That is if the iterator points to name #3, getLocale has to return the correct value for name #3. 

Problem:

Now if you subclass ResourceNameIterator and replace the iterator functionality, the subclass doesnt have access to the private field localeIterator which the FINAL method getLocale uses as the source of the current value. Thus it is impossible to still fulfill the basic rule as stated above. Basically any usecase which actually changes ResourceNameIterator breaks the rule.

                
> Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator
> ------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4530
>                 URL: https://issues.apache.org/jira/browse/WICKET-4530
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5, 6.0.0-beta1
>            Reporter: Jan Riehn
>              Labels: IResourceStreamLocator, ResourceNameIterator, resource
>
> IResourceStreamLocator contains the method newResourceNameIterator(...) which builds a ResourceNameIterator. Unfortunately ResourceNameIterator declares several getter methods (getLocale(), getStyle(), getVariation(), getExtension()) as final and thus ties the public API to the internal implementation of ResourceNameIterator. Therefore it's not possible to fully customize the behavior of ResourceNameIterator by subclassing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4530) Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13269571#comment-13269571 ] 

Martin Grigorov commented on WICKET-4530:
-----------------------------------------

What is your use case ?
Why do you want different behavior from #getLocale() for example ?
                
> Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator
> ------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4530
>                 URL: https://issues.apache.org/jira/browse/WICKET-4530
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5, 6.0.0-beta1
>            Reporter: Jan Riehn
>              Labels: IResourceStreamLocator, ResourceNameIterator, resource
>
> IResourceStreamLocator contains the method newResourceNameIterator(...) which builds a ResourceNameIterator. Unfortunately ResourceNameIterator declares several getter methods (getLocale(), getStyle(), getVariation(), getExtension()) as final and thus ties the public API to the internal implementation of ResourceNameIterator. Therefore it's not possible to fully customize the behavior of ResourceNameIterator by subclassing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4530) Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator

Posted by "Christian Oldiges (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13270266#comment-13270266 ] 

Christian Oldiges commented on WICKET-4530:
-------------------------------------------

For 1.5 I would suggest to simply remove the final modifiers of the getters to avoid a breaking API change.
For 6.0 a new IResourceNameIterator makes more sense.
                
> Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator
> ------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4530
>                 URL: https://issues.apache.org/jira/browse/WICKET-4530
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5, 6.0.0-beta1
>            Reporter: Jan Riehn
>            Assignee: Sven Meier
>              Labels: IResourceStreamLocator, ResourceNameIterator, resource
>
> IResourceStreamLocator contains the method newResourceNameIterator(...) which builds a ResourceNameIterator. Unfortunately ResourceNameIterator declares several getter methods (getLocale(), getStyle(), getVariation(), getExtension()) as final and thus ties the public API to the internal implementation of ResourceNameIterator. Therefore it's not possible to fully customize the behavior of ResourceNameIterator by subclassing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4530) Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator

Posted by "Jan Riehn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13270322#comment-13270322 ] 

Jan Riehn commented on WICKET-4530:
-----------------------------------

I totally agree with Christian. Removing the final modifiers of the getters in 1.5 avoids an API break. For 6.0 it's straightforward to introduce a IResourceNameIterator. 
                
> Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator
> ------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4530
>                 URL: https://issues.apache.org/jira/browse/WICKET-4530
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5, 6.0.0-beta1
>            Reporter: Jan Riehn
>            Assignee: Sven Meier
>              Labels: IResourceStreamLocator, ResourceNameIterator, resource
>
> IResourceStreamLocator contains the method newResourceNameIterator(...) which builds a ResourceNameIterator. Unfortunately ResourceNameIterator declares several getter methods (getLocale(), getStyle(), getVariation(), getExtension()) as final and thus ties the public API to the internal implementation of ResourceNameIterator. Therefore it's not possible to fully customize the behavior of ResourceNameIterator by subclassing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4530) Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator

Posted by "Sven Meier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier resolved WICKET-4530.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5.7
                   6.0.0-RC1

Introduced new interface IResourceNameIterator in Wicket 6.
To keep ABI compatibility in 1.5.x, the getters in ResourceNameIterator are no longer final. 
                
> Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator
> ------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4530
>                 URL: https://issues.apache.org/jira/browse/WICKET-4530
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5, 6.0.0-beta1
>            Reporter: Jan Riehn
>            Assignee: Sven Meier
>              Labels: IResourceStreamLocator, ResourceNameIterator, resource
>             Fix For: 6.0.0-RC1, 1.5.7
>
>
> IResourceStreamLocator contains the method newResourceNameIterator(...) which builds a ResourceNameIterator. Unfortunately ResourceNameIterator declares several getter methods (getLocale(), getStyle(), getVariation(), getExtension()) as final and thus ties the public API to the internal implementation of ResourceNameIterator. Therefore it's not possible to fully customize the behavior of ResourceNameIterator by subclassing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (WICKET-4530) Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator

Posted by "Sven Meier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier reassigned WICKET-4530:
----------------------------------

    Assignee: Sven Meier
    
> Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator
> ------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4530
>                 URL: https://issues.apache.org/jira/browse/WICKET-4530
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5, 6.0.0-beta1
>            Reporter: Jan Riehn
>            Assignee: Sven Meier
>              Labels: IResourceStreamLocator, ResourceNameIterator, resource
>
> IResourceStreamLocator contains the method newResourceNameIterator(...) which builds a ResourceNameIterator. Unfortunately ResourceNameIterator declares several getter methods (getLocale(), getStyle(), getVariation(), getExtension()) as final and thus ties the public API to the internal implementation of ResourceNameIterator. Therefore it's not possible to fully customize the behavior of ResourceNameIterator by subclassing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4530) Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator

Posted by "Sven Meier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13269782#comment-13269782 ] 

Sven Meier commented on WICKET-4530:
------------------------------------

I remember speaking with Jan about the problem of providing a custom name iterating scheme.

What's the suggested fix? Would introducing an interface help here?

                
> Final methods on ResourceNameIterator prevent full customization of IResourceStreamLocator
> ------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4530
>                 URL: https://issues.apache.org/jira/browse/WICKET-4530
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5, 6.0.0-beta1
>            Reporter: Jan Riehn
>              Labels: IResourceStreamLocator, ResourceNameIterator, resource
>
> IResourceStreamLocator contains the method newResourceNameIterator(...) which builds a ResourceNameIterator. Unfortunately ResourceNameIterator declares several getter methods (getLocale(), getStyle(), getVariation(), getExtension()) as final and thus ties the public API to the internal implementation of ResourceNameIterator. Therefore it's not possible to fully customize the behavior of ResourceNameIterator by subclassing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira