On Tue, May 15, 2012 at 9:29 PM, Vincent Massol <[email protected]> wrote:
>
> On May 15, 2012, at 8:28 PM, Vincent Massol wrote:
>
>> Hi Marius,
>>
>> On May 15, 2012, at 7:54 PM, Marius Dumitru Florea wrote:
>>
>>> Hi devs,
>>>
>>> I just committed a new Velocity uberspector that automatically
>>> converts String method arguments to Enum when possible. Please review
>>> it and tell me if there's something wrong.
>>
>> Seems ok, can't find anything that wouldn't work for the moment :)
>>
>>> The idea is to be able to call #someMethod(SomeEnum) with
>>>
>>> $obj.someMethod('VALUE')
>>
>> What if I call #someMethod(String, SomeEnum)
>>
>> with
>>
>> $obj.someMethod(string, myEnum)
>>
>> Does it work? (same question with any number of arguments)
>>
>> If not then maybe it's a bit inconsistent and some users may not understand 
>> why it works and then suddenly fail to work in the following case: imagine 
>> that the method has one param initially (the enum) and a second param is 
>> added later on.
>
> ok I've looked at the code now and it seems it's supported, so it's cool.

Yes, it should work with any number of parameters. Now, if you have both

#someMethod(String, String)
#someMethod(String, SomeEnum)

the first will be called because it will be found by the default
Velocity introspector. But that's an edge case.

Thanks,
Marius

>
> Thanks
> -Vincent
>
>>
>> Thanks
>> -Vincent
>>
>>> if SomeEnum.VALUE is a valid constant.
>>>
>>> See 
>>> https://github.com/xwiki/xwiki-commons/commit/dbf1e06cc4f949c6f0b5a03c57067174cc620888
>>> .
>>>
>>> Thanks,
>>> Marius
>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to