Fixed with https://issues.apache.org/jira/browse/WICKET-3896

On Wed, Jul 13, 2011 at 5:48 PM, Martin Grigorov <mgrigo...@apache.org> wrote:
> Good catch!
> Please create a ticket.
>
> On Wed, Jul 13, 2011 at 5:46 PM, Fabio Cechinel Veronez
> <fabio.vero...@gmail.com> wrote:
>> Hello all,
>>
>> I was in doubt whether this message should be sent to user or dev list
>> so following http://wicket.apache.org/help/email.html page
>> recommendation I'm sending it to user list.
>>
>> Well, I was trying wicket-1.5-RC5.1 and I notice that PageParameters
>> class implements two new interfaces IIndexedParameters and
>> INamedParameters. What called my attention was that methods defined at
>> those interfaces are defined to return the implementation type
>> (PageParameters). Ex:
>>
>> public interface INamedParameters {
>>    //...
>>    PageParameters remove(final String name);
>>    //...
>> }
>>
>> public interface IIndexedParameters {
>>    //...
>>    PageParameters set(final int index, final Object object);
>>    //...
>> }
>>
>> What is the point of it? This way if one want to implement this
>> interface he won't be able to return his implementation instance.
>>
>> Wouldn't be better to have the interface methods returning the
>> interface types and use covariant return type on implementation type?
>> Like:
>>
>> public interface INamedParameters {
>>    //...
>>    INamedParameters remove(final String name);
>>    //...
>> }
>>
>> public interface IIndexedParameters {
>>    //...
>>    IIndexedParameters set(final int index, final Object object);
>>    //...
>> }
>>
>> public class PageParameters implements Serializable,
>> IIndexedParameters, INamedParameters {
>>
>>    //...
>>    PageParameters set(final int index, final Object object) {
>>        //...
>>        return this;
>>    }
>>    //...
>>
>>    //...
>>    PageParameters remove(final String name) {
>>        //...
>>        return this;
>>    }
>>    //...
>> }
>>
>> Thanks in advance.
>>
>> --
>> Fabio Cechinel Veronez
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to