Uploaded image for project: 'HiveMind'
  1. HiveMind
  2. HIVEMIND-200

Hivemind configuration injection always produces a List

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1.1
    • None
    • framework
    • None

    Description

      Suppose we need to create <configuration> in hivemodule.xml which holds a simple map. As the documentation states, all we need is to specify key-attribute parameter and write a simple translating rule.

      Then in .jwc we write something like this:

      <inject property="map" object="configuration:somemodule.ConfigMap"/>

      <component id="test" type="Insert">
      <binding name="value" value="map.get('someKey')"/>
      </component>

      ...and happily receive an OGNLException informing us that 'someKey' can hardly be converted into a number.

      That's because injected configurations is always injected as List even when the magic parameter key-attribute is specified. With abstract property accessor of type Map we receive another exception requiring to change method return parameter to something like List.

      The source of this problem lies somewhere in InjectValueTranslatorImpl that passes Object.class as the parameter type to ObjectTranslator. I suppose there must be not Object.class but a real property class received from EnhancementWorker.

      For now I've created a special translation prefix "configuration-map" that returns Map if required parameter type can be assigned from Map, but I'm looking forward to bugfix

      Attachments

        Activity

          People

            Unassigned Unassigned
            zverik Ilya Zverev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: