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 10478] - Can't use . (dot) in mapped properties
Date Sat, 21 Sep 2002 10:01:40 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=10478>.
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=10478

Can't use . (dot) in mapped properties

jakarta@tichny.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |



------- Additional Comments From jakarta@tichny.org  2002-09-21 10:01 -------
The fix introduced breaks the following syntax:
BeanUtils.getProperty("a.b(x)"), i.e. a simple nested property before the mapped
property.

This is due to lines 711ff in PropertyUtils.java:

 indexOfMAPPED_DELIM2 = name.indexOf(MAPPED_DELIM2);
 if (indexOfMAPPED_DELIM2 >= 0) {
     indexOfNESTED_DELIM =
        name.indexOf(NESTED_DELIM, indexOfMAPPED_DELIM2);
 } else {
     indexOfNESTED_DELIM = name.indexOf(NESTED_DELIM);
 }
 if (indexOfNESTED_DELIM < 0) {
     break;
 }

so the example ends up in looking up a mappedProperty "a.b" with key "x" which
finally leads to an "IllegalArgumentException: object is
not an instance of declaring class" (the gett-method looked up on "b" is called
on bean "a" in "getMappedProperty()")

roland

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