commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 7929] - PropertyUtils.gerProperty fails on a class named Component
Date Thu, 11 Apr 2002 19:25:02 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7929>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7929

PropertyUtils.gerProperty fails on a class named Component

craig.mcclanahan@sun.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX



------- Additional Comments From craig.mcclanahan@sun.com  2002-04-11 19:25 -------
You're going to be amazed at why this one doesn't work, and can't easily be
fixed ... :-)

The BeanUtils package uses the standard JavaBeans introspection mechanisms to
determine the names of property getter and setter methods.  Among other things,
that means:

- BeanUtils will respect BeanInfo classes for your beans, if you want to
  customize the actual getter and setter method names, or any other aspect
  of the introspection information returned about your bean.

- To locate BeanInfo classes, it looks in the same package as the bean class
  itself, then (if none is found) uses the local class name part of the bean
  class name and looks in a standard search path.

- The standard search path has a default (for the Sun provided JREs and JDKs)
  package of "sun.beans.infos".

- There is (you guessed it) a class "ComponentBeanInfo" in the
  sun.beans.infos package

Therefore, the introspection information about a user class named Component will
always be taken from this file, instead of from your own class.  Unless you go
remove sun/beans/infos/ComponentBeanInfo.class from the "jre/lib/rt.jar" file of
your JDK or JRE (and thereby probably mess up something internal), the only
workaround is to name your application bean class anything *except* Component.java.

--
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