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 28358] - Problems on indexed property with JDK 1.4
Date Mon, 17 May 2004 20:40:21 GMT
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=28358>.
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=28358

Problems on indexed property with JDK 1.4





------- Additional Comments From Joe@Germuska.com  2004-05-17 20:40 -------
Whoops; I attached too soon, but I still can't reproduce the problem.  I will upload an extended
test 
class which uses PropertyUtils.getIndexedProperty.

    public static void main(String[] args) throws Exception
    {

        PropertyUtilsTestBean bean = new PropertyUtilsTestBean();
        PropertyDescriptor pd = PropertyUtils.getPropertyDescriptor(bean, "stringList");
        System.out.println("pd for stringList: " + pd);
        pd = PropertyUtils.getPropertyDescriptor(bean, "stringArray");
        System.out.println("pd for stringArray: " + pd);

        String[] testArray = new String[] { "zero", "one", "two" };
        bean.setStringArray(testArray);
        ArrayList testList = new ArrayList();
        for (int i = 0; i < testArray.length; i++)
        {
            testList.add(testArray[i]);
        }
        bean.setStringList(testList);

        for (int i = 0; i < testArray.length; i++)
        {
            System.out.println("from accessor: stringArray[" + i + "]: " 
                + bean.getStringArray(i));
            System.out.println("from getIndexedProperty: stringArray[" + i + "]: " 
                + PropertyUtils.getIndexedProperty(bean, "stringArray", i));
            System.out.println("from accessor: stringList[" + i + "]: " 
                + bean.getStringList(i));
            System.out.println("from getIndexedProperty: stringList[" + i + "]: " 
                + PropertyUtils.getIndexedProperty(bean, "stringList", i));
        }
    }

results:
% java PropertyUtilsTestBean
pd for stringList: java.beans.IndexedPropertyDescriptor@8d107f
pd for stringArray: java.beans.IndexedPropertyDescriptor@5224ee
from accessor: stringArray[0]: zero
from getIndexedProperty: stringArray[0]: zero
from accessor: stringList[0]: zero
from getIndexedProperty: stringList[0]: zero
from accessor: stringArray[1]: one
from getIndexedProperty: stringArray[1]: one
from accessor: stringList[1]: one
from getIndexedProperty: stringList[1]: one
from accessor: stringArray[2]: two
from getIndexedProperty: stringArray[2]: two
from accessor: stringList[2]: two
from getIndexedProperty: stringList[2]: two

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