You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martin Grigorov <mg...@apache.org> on 2010/11/13 21:22:12 UTC

IConverter generics

Hi,

I noticed that IConverter doesn't use generics..
Quick search showed https://issues.apache.org/jira/browse/WICKET-1568
Peter provided a patch and Johan closed it as "Fixed".
The ticket itself has no commits and IConverter and impls. don't use
generics in 1.4 and 1.5

What's the reason ?

martin-g

Re: IConverter generics

Posted by Igor Vaynberg <ig...@gmail.com>.
thanks.

-igor

On Sun, Nov 14, 2010 at 10:58 AM, Martin Grigorov <mg...@apache.org> wrote:
> Improved and committed.
>
> On Sun, Nov 14, 2010 at 5:25 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> +                               IConverter<Object> converter =
>> (IConverter<Object>)getConverter(displayClass);
>>
>> yuck, but oh well, we will have to live with it.
>>
>> -                                       return new IConverter()
>> +                                       return (IConverter<C>)new
>> IConverter<URL>()
>>
>> since you are already in there, can you add a test for
>> clazz,isassignableromurl() and only return the converter then? there
>> are a couple of places in the patch blindly return a converter
>> ignoring the class, its wrong.
>>
>> thanks,
>>
>> -igor
>>
>> On Sun, Nov 14, 2010 at 3:41 AM, Martin Grigorov <mg...@apache.org>
>> wrote:
>> >
>> https://issues.apache.org/jira/secure/attachment/12459553/WICKET-1568.patch
>> >
>> > Please review.
>> >
>> > On Sat, Nov 13, 2010 at 9:37 PM, Igor Vaynberg <igor.vaynberg@gmail.com
>> >wrote:
>> >
>> >> it didnt apply as cleanly as we liked
>> >>
>> >> if we dont tie it to the type of the component it might work:
>> >>
>> >>        public <C> IConverter<C> getConverter(Class<C> type)
>> >>
>> >> give that a try and see if you find any weird areas.
>> >>
>> >> -igor
>> >>
>> >> On Sat, Nov 13, 2010 at 12:22 PM, Martin Grigorov <mgrigorov@apache.org
>> >
>> >> wrote:
>> >> > Hi,
>> >> >
>> >> > I noticed that IConverter doesn't use generics..
>> >> > Quick search showed https://issues.apache.org/jira/browse/WICKET-1568
>> >> > Peter provided a patch and Johan closed it as "Fixed".
>> >> > The ticket itself has no commits and IConverter and impls. don't use
>> >> > generics in 1.4 and 1.5
>> >> >
>> >> > What's the reason ?
>> >> >
>> >> > martin-g
>> >> >
>> >>
>> >
>>
>

Re: IConverter generics

Posted by Martin Grigorov <mg...@apache.org>.
Improved and committed.

On Sun, Nov 14, 2010 at 5:25 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> +                               IConverter<Object> converter =
> (IConverter<Object>)getConverter(displayClass);
>
> yuck, but oh well, we will have to live with it.
>
> -                                       return new IConverter()
> +                                       return (IConverter<C>)new
> IConverter<URL>()
>
> since you are already in there, can you add a test for
> clazz,isassignableromurl() and only return the converter then? there
> are a couple of places in the patch blindly return a converter
> ignoring the class, its wrong.
>
> thanks,
>
> -igor
>
> On Sun, Nov 14, 2010 at 3:41 AM, Martin Grigorov <mg...@apache.org>
> wrote:
> >
> https://issues.apache.org/jira/secure/attachment/12459553/WICKET-1568.patch
> >
> > Please review.
> >
> > On Sat, Nov 13, 2010 at 9:37 PM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> it didnt apply as cleanly as we liked
> >>
> >> if we dont tie it to the type of the component it might work:
> >>
> >>        public <C> IConverter<C> getConverter(Class<C> type)
> >>
> >> give that a try and see if you find any weird areas.
> >>
> >> -igor
> >>
> >> On Sat, Nov 13, 2010 at 12:22 PM, Martin Grigorov <mgrigorov@apache.org
> >
> >> wrote:
> >> > Hi,
> >> >
> >> > I noticed that IConverter doesn't use generics..
> >> > Quick search showed https://issues.apache.org/jira/browse/WICKET-1568
> >> > Peter provided a patch and Johan closed it as "Fixed".
> >> > The ticket itself has no commits and IConverter and impls. don't use
> >> > generics in 1.4 and 1.5
> >> >
> >> > What's the reason ?
> >> >
> >> > martin-g
> >> >
> >>
> >
>

Re: IConverter generics

Posted by Igor Vaynberg <ig...@gmail.com>.
+				IConverter<Object> converter =
(IConverter<Object>)getConverter(displayClass);

yuck, but oh well, we will have to live with it.

-					return new IConverter()
+					return (IConverter<C>)new IConverter<URL>()

since you are already in there, can you add a test for
clazz,isassignableromurl() and only return the converter then? there
are a couple of places in the patch blindly return a converter
ignoring the class, its wrong.

thanks,

-igor

On Sun, Nov 14, 2010 at 3:41 AM, Martin Grigorov <mg...@apache.org> wrote:
> https://issues.apache.org/jira/secure/attachment/12459553/WICKET-1568.patch
>
> Please review.
>
> On Sat, Nov 13, 2010 at 9:37 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> it didnt apply as cleanly as we liked
>>
>> if we dont tie it to the type of the component it might work:
>>
>>        public <C> IConverter<C> getConverter(Class<C> type)
>>
>> give that a try and see if you find any weird areas.
>>
>> -igor
>>
>> On Sat, Nov 13, 2010 at 12:22 PM, Martin Grigorov <mg...@apache.org>
>> wrote:
>> > Hi,
>> >
>> > I noticed that IConverter doesn't use generics..
>> > Quick search showed https://issues.apache.org/jira/browse/WICKET-1568
>> > Peter provided a patch and Johan closed it as "Fixed".
>> > The ticket itself has no commits and IConverter and impls. don't use
>> > generics in 1.4 and 1.5
>> >
>> > What's the reason ?
>> >
>> > martin-g
>> >
>>
>

Re: IConverter generics

Posted by Martin Grigorov <mg...@apache.org>.
https://issues.apache.org/jira/secure/attachment/12459553/WICKET-1568.patch

Please review.

On Sat, Nov 13, 2010 at 9:37 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> it didnt apply as cleanly as we liked
>
> if we dont tie it to the type of the component it might work:
>
>        public <C> IConverter<C> getConverter(Class<C> type)
>
> give that a try and see if you find any weird areas.
>
> -igor
>
> On Sat, Nov 13, 2010 at 12:22 PM, Martin Grigorov <mg...@apache.org>
> wrote:
> > Hi,
> >
> > I noticed that IConverter doesn't use generics..
> > Quick search showed https://issues.apache.org/jira/browse/WICKET-1568
> > Peter provided a patch and Johan closed it as "Fixed".
> > The ticket itself has no commits and IConverter and impls. don't use
> > generics in 1.4 and 1.5
> >
> > What's the reason ?
> >
> > martin-g
> >
>

Re: IConverter generics

Posted by Igor Vaynberg <ig...@gmail.com>.
it didnt apply as cleanly as we liked

if we dont tie it to the type of the component it might work:

	public <C> IConverter<C> getConverter(Class<C> type)

give that a try and see if you find any weird areas.

-igor

On Sat, Nov 13, 2010 at 12:22 PM, Martin Grigorov <mg...@apache.org> wrote:
> Hi,
>
> I noticed that IConverter doesn't use generics..
> Quick search showed https://issues.apache.org/jira/browse/WICKET-1568
> Peter provided a patch and Johan closed it as "Fixed".
> The ticket itself has no commits and IConverter and impls. don't use
> generics in 1.4 and 1.5
>
> What's the reason ?
>
> martin-g
>