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

[beanutils] Indexed property inside a mapped property cannot be accessed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6
    • 1.8.0
    • Expression Syntax
    • None
    • Operating System: All
      Platform: All

    • 32380

    Description

      Hi, guys.

      Suppose I have a Map, let's call it "building", inside that map I have an entry
      with key "rooms", which is a Collection. If I try to access room number 20 like
      this:

      "building.rooms[20].type" it doesn't work (throws IllegalArgumentException).

      I made a custom implementation of "building" Map so that I can see what param is
      passed to the get() method. Surprisingly I see, that
      PropertyUtilsBean.getInstance().getProperty(bean, name) calls get() method on my
      Map with parameter "rooms[20]" (including index part).

      This is definitely a bug, because getProperty() should recognize, that "rooms"
      is an indexed property (because it has []), so it should cut off "[20]", call
      get("rooms") and then obtain element with index 20 from the retrieved Collection.

      Please have a look.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vspa@mail.ru Firepica
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: