Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-5190

Module configuration map does not load class values

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Outdated
    • Icon: Major Major
    • None
    • 5.0.1
    • content2bean

      Exact same structure works on 4.5.
      i have configuration

      • groups
        • group1
          • label
          • value

      On debug i see groups=null=null, groups is a map of string, labelvalueclass

      jsimak:
      Assume:

      private Map<String, DefaultKeyValue> groups;
      ..
      void setGroups(Map<String, DefaultKeyValue> groups) { this.groups = groups; }
      

      Content2Bean (4.5) will not resolve DefaultKeyValue as a type (it will create LinkedHashMap instead) and since generics informations are not present at runtime, the content2bean sets LinkedHashMap as a value instead of DefaultKeyValue type. So structure of groups look like this: Map<String, Map>.

      Node2Bean (5.0+) will resolve DefaultKeyValue type from generics, instantiates this type and later node2bean will try to populate DefaultKeyValue object with values (via BeanUtils) but it won't fill any value to the object (because we pass for example property name label but DefaultKeyValue doesn't have any setter called setLabel).

        Acceptance criteria

              Unassigned Unassigned
              tmiyar Teresa Miyar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD