Commons Configuration
  1. Commons Configuration
  2. CONFIGURATION-91

[configuration] Problem adding property XMLConfiguration

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      CharacterData data = document.createTextNode((String) value); seems to be
      adding array elements into one string versus multiple elements. The XML
      should look like:

      <test>
      <array>value1</array>
      <array>value2</array>
      <array>value3</array>
      <array>value4</array>
      </test>

      However, it looks like:
      <test>
      <array>value1value2value3value4</array>
      </test>

      The same basic problem occurs with this loop:
      // add an array of strings in an attribute
      for (int i = 1; i < 5; i++)

      { conf.addProperty("test.attribute[@array]", "value" + i); }

      However, in this case, instead of add value1, value2, etc:
      <test>
      <attribute array="value1"/>
      <attribute array="value2"/>
      <attribute array="value3"/>
      <attribute array="value4"/>
      </test>

      we get just:
      <test>
      <attribute array="value4"/>
      </test>

        Activity

        Hide
        David Eric Pugh added a comment -

        Thanks for the patch! I have applied it. as a note for the future, when you
        attach a patch, make sure other stuff doesn't creep in. I'm guessing you have
        both your patch for this bug, as well as the map stuff in your ide

        check out the changes.xml doc!

        Eric Pugh

        Show
        David Eric Pugh added a comment - Thanks for the patch! I have applied it. as a note for the future, when you attach a patch, make sure other stuff doesn't creep in. I'm guessing you have both your patch for this bug, as well as the map stuff in your ide check out the changes.xml doc! Eric Pugh
        Hide
        Ricardo Gladwell added a comment -

        Created an attachment (id=12393)
        Patch fixes this bug and passes XMLConfiguration JUnit tests.

        Show
        Ricardo Gladwell added a comment - Created an attachment (id=12393) Patch fixes this bug and passes XMLConfiguration JUnit tests.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ricardo Gladwell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development