DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28254>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28254

getIndexedProperty problems on JDK 1.4.1

           Summary: getIndexedProperty problems on JDK 1.4.1
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Bean Utilities
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I'm experiencing problems porting an existing struts 1.1 application on JDK 1.4.
Debugging the code, i have seen that the problem occur in getIndexedProperty, 
because on jdk 1.3.1_02 return an instance of IndexedPropertyDescriptor while 
in jdk 1.4.1_02 not!
To use indexed property on struts, whe declare 2 methods on the ActionForm: one 
that return the entire list and one that return an indexed element

A simple class that reproduce the problem is:

public class FooForm extends ValidatorForm {

        protected List childs = new ArrayList(0);
        
        ...

        }
        public List getChilds() {
                return childs;
        }

        public ChildsBean getChilds(int index) {
                if (index + 1 > childs.size()) {
                        for (int i = childs.size(); i < index + 1; i++)  {
                                childs.add(new ChildsBean());
                        }
                }
                return (ChildsBean) childs.get(index);
        }
        
        ....
}
        
and the problem occur when i preload the forms values using a code like this

for (int j = 0; j < newChilds.size(); j++)  {
   BeanUtils.copyProperties(PropertyUtils.getIndexedProperty
(valBean,"childs",j), newChilds.get(j));
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to