jastrachan | 27 May 20:10 2004
Picon

Re: [groovy-dev] patch for Object.eachPropertyName()


On 27 May 2004, at 17:31, John Stump wrote:

> Hi James,
>
> I know you're on your honeymoon for a while, but I'll go ahead
> and get this in your inbox while it is fresh in my mind (BTW:
> congrats!).

Thanks!

> The MetaProperty changes are pretty much done, but there are
> some lingering issues that keep this from being a pretty
> solution. The way we handle protected fields is a little sloppy.
> I wish there was a better way to handle this case, but a
> solution escapes me at the moment.

Agreed

> I think there is a possible bug with the handling of generic
> get() returns. If it returns null, then the code assumes that
> the property was not found and it tries other avenues. This
> precludes a property being handled by a generic get() from
> actually having a value of null...

Yep. I guess there's always the option of folks supplying special 
MetaClass instances to do clever stuff.

> Also, I think there is a possible bug with respect to generic
> set(). I believe this should be the last thing we try, however,
> it is tried before setX() is tried.

Agreed!

> This means that if a super
> class defines a generic set(), we can't set protected fields
> from a child class *unless* we handle it in the generic set().
>
> All in all, the MetaProperty changes improve the code slightly
> and gives a little better runtime performance, but I think there
> is still a lot of special cases we have to deal with.

Agreed. We could do with exploring more of these edge cases.

> I will test my changes a little more and submit the patch to the
> JIRA issue.

Great! Many thanks John!

BTW you could maybe pester Guillaume to apply your patches in my 
absense - if not I'll do it as a priority when I get back in 2-3 weeks.

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

Gmane