commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Boland" <bola...@attbi.com>
Subject PropertyUtils.getPropertyDescriptor() bug?
Date Wed, 08 May 2002 00:10:58 GMT
I was just trying to understand how the BeanUtils.populate() worked
which led me to understanding how the PropertyUtils.
getPropertyDescriptor() worked.

As I was looking at this, something didn't look right. It probably just
my unfamiliarity with this but the last few lines that put the result
into the cache didn't jive with the code above or the comment on the
cache. The lines:

        if (result != null) {
            mappedDescriptorsCache.put(name, result);
        }
        return result;

shouldn't this use the bean's class object as the key?

        if (result != null) {
            mappedDescriptorsCache.put(bean.getClass(), result);
        }
        return result;

not the name of the property. If so, this might help the performance a
bit.

I tried to look in the archives to see if this was a common
misconception but it seems to be down at the moment so I thought I'd
subscribe to the list and send this out.






--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message