commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pawan Kumar Shrivastava (JIRA)" <j...@apache.org>
Subject [jira] Created: (BEANUTILS-245) Problem setting nested index property or combined property (with index property)
Date Fri, 04 Aug 2006 12:57:13 GMT
Problem setting nested index property or combined property (with index property)
--------------------------------------------------------------------------------

                 Key: BEANUTILS-245
                 URL: http://issues.apache.org/jira/browse/BEANUTILS-245
             Project: Commons BeanUtils
          Issue Type: Bug
    Affects Versions: 1.7.0 Release
         Environment: Windows XP Professional, Java 5
            Reporter: Pawan Kumar Shrivastava


This is the specific problem, when you are setting a nested index property i.e.  - 
list1[0].value

Now i have initialized list1 as = new ArrayList(). Obviously the size is 0. So PropertyUtils
uses List.set(index, value) method, which throws IndexOutOfBoundsException as the size and
index are same.

I think it should check the index and size first and then decide whether to call add(index,
value) or set(index, value).

Please let me know, if my understanding is wrong. One potential misuse i can see is what if
someone passes index 100. But not sure if this can be resolved by somehow shrinking the list.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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