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

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[EMAIL PROTECTED]
          Component|Unknown                     |Bean Utilities
            Product|Struts                      |Commons
            Version|1.1 Final                   |1.6 Final



------- Additional Comments From [EMAIL PROTECTED]  2004-05-17 20:33 -------
I wrote a test class, PropertyUtilsTestBean (see attachment) which has two forms of 
indexed property -- 
one whose unindexed accessor returns String[] and another whose unindexed accessor 
returns 
ArrayList.  This is the main method of the same bean:

    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("stringArray[" + i + "]: " + bean.getStringArray(i));
            System.out.println("stringList[" + i + "]: " + bean.getStringList(i));
        }
        
        
    }

Here's what I get:
% java -version
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-117.1)
Java HotSpot(TM) Client VM (build 1.4.2-34, mixed mode)

% java PropertyUtilsTestBean
pd for stringList: [EMAIL PROTECTED]
pd for stringArray: [EMAIL PROTECTED]
stringArray[0]: zero
stringList[0]: zero
stringArray[1]: one
stringList[1]: one
stringArray[2]: two
stringList[2]: two

This is using Beanutils 1.6.1 and Collections 2.1 -- same as Struts.

So, basically, I can't reproduce the bug.  I'm reassigning this to commons-beanutils 
away from Struts, 
but unless someone can reproduce the bug or attach a program which does, I think this 
should be 
marked invalid.

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

Reply via email to