Uploaded image for project: 'Commons BeanUtils'
  1. Commons BeanUtils
  2. BEANUTILS-247

Arrays with multiple dimension are not supported

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.0
    • 1.8.0
    • Expression Syntax
    • None
    • I run BeanUtils on Windows XP with Eclipse 3.1.1.

    Description

      When an array with multiple dimension is used, accessing and setting properties is not supported.

      For instance, the call to PropertyUtils.getNestedProperty(myObject, "multiArray[0][0].id") fails since the second array index is never used.
      This raises the following exception.
      Exception in thread "main" java.lang.NoSuchMethodException: Unknown property 'id'
      at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1122)
      at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
      at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:272)
      at Test.main(Test.java:24)

      The "id" property does exists in the object "multiArray[0][0]" and if I make a call to multiArray[0][0].getId(), the correct value is returned.

      Attachments

        1. PropertyUtilsBean.java
          72 kB
          Christian Poitras
        2. beanerror.zip
          0.7 kB
          Christian Poitras

        Issue Links

          Activity

            People

              niallp Niall Pemberton
              mindtrap Christian Poitras
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: