jastrachan | 14 Jul 17:30 2004
Picon

Re: [groovy-dev] Call for patches

On 14 Jul 2004, at 16:15, John Stump wrote:
> --- jastrachan@... wrote:
>> On 13 Jul 2004, at 20:44, jastrachan@... wrote:
>>> On 12 Jul 2004, at 16:07, John Stump wrote:
>>>
>>>> I've got a big patch for issue 464. This rewrites the
>> properties
>>>> get/set logic that James and I talked about before he went
>> off
>>>> on his honeymoon. I did this patch some time ago and
>> haven't
>>>> kept up with CVS Head. I don't know if I will have time to
>>>> update the patch to head...sorry
>>>
>>> Patch applied John, many thanks!
>>
>> BTW a test case for the new stuff would be cool :)
>>
>> I was hoping your patch would allow us to use the .length
>> property on
>> arrays so that we could do
>>
>>      array = new String[] { "x", "y" }
>>      println array.length
>>
>> but it doesn't seem to. I wonder if there's a bug somewhere in
>> the new
>> property/field stuff?
>
> It's probably a bug. I'm also seeing that a child class
> attempting to access a protected field from the parent class
> fails.

Actually bing answered that one on another thread today - 'length' 
doesn't show up as a field via getDeclaredFields(). So we'll have to 
detect array types in MetaClass and add a special MetaProperty 
implementation which calls Arrays.getLength(array) instead.

>  I'll look into these...

Thanks!

James
-------
http://radio.weblogs.com/0112098/


Gmane