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 17036] New: - PropertyUtils doesn't recognise "normal" properties on a DynaBean decendent object.
Date Thu, 13 Feb 2003 00:51:26 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=17036>.
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=17036

PropertyUtils doesn't recognise "normal" properties on a DynaBean decendent object.

           Summary: PropertyUtils doesn't recognise "normal" properties on a
                    DynaBean decendent object.
           Product: Commons
           Version: 1.6 Final
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Bean Utilities
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: gavin@objectconnections.com


When using the PropertyUtils "normal" (non DynaProperty) properties are not 
recognised on an object decended from a DynaBean.
On an object not decended from a DynaBean the PropertyUtils method 
getPropertyType, getProperty, setProperty etc recognise methods of the form 
getXYZ, setXYZ etc. On an object that is decended from a DynaBean the 
PropertyUtils only check for a DyanProperty of the specified name before 
raising an exception.
Code below:

        // Handle DynaBean instances specially
        if (bean instanceof DynaBean) {
            DynaProperty descriptor =
                    ((DynaBean) bean).getDynaClass().getDynaProperty(name);
            if (descriptor == null) {
                throw new NoSuchMethodException("Unknown property '" +
                        name + "'");
            }
            return (((DynaBean) bean).get(name, index));
        }

Can this be changed so that it falls through and checks all other options 
before raising an exception?

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


Mime
View raw message