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 13898] New: - populate fails with mapped properties
Date Wed, 23 Oct 2002 18:11:13 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=13898>.
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=13898

populate fails with mapped properties

           Summary: populate fails with mapped properties
           Product: Commons
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Bean Utilities
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: emillan22@hotmail.com


I've been trying the 'populate' method from BeanUtils 1.4.1. I notice that when
you use mapped properties and want to hold Objects of any kind different of
'String' into that Map you get an error because all bean properties requested
are processed in an unspecified order.

For example:

I've got a Bean like this:

Bean Test.
 Property name (String)
 Property items (java.util.Map)
 
Into the 'items' property i want to hold 'Article' objects:

Bean Article.
 Property id (String)
 Property name (String)

There may be one or most 'articles' into Test 'items' property.

(The next may be is not important. Begin...).
To populate Test bean,before i create a converter and register it.
TestConverter (converts Map properties and fills in a new Article object instance).
Registered with ConvertUtils.register(new TestConverter(), Map.class)
(end of not important stuff.)

Ok, so when i populate a Test bean with 3 or more Article beans into it, i get
random errors cause (in my opinion) the 'BeanUtils.populate' method processes
the properties in a not specified order. The method tries to populate
"items(one).id" before "items(one)" (the one that fills the map with a new
instance).

Why not to process simple properties first, and then indexed/mapped properties,
and then nested properties?

Thanks.

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