Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-750

XMLPropertyListConfiguration cannot set arrays in the correct plist form

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.6
    • Component/s: Format
    • Labels:
      None

      Description

      This is the same as CONFIGURATION-427 except that it applies to setProperty which was missed in the original fix.

      final FileBasedConfigurationBuilder<FileBasedConfiguration> builder =
              new FileBasedConfigurationBuilder<>(XMLPropertyListConfiguration.class);
      final FileBasedConfiguration configuration = builder.getConfiguration();
      configuration.setProperty("things", ['chair', 'hat', 'door']);
      final FileHandler fileHandler = new FileHandler(configuration);
      fileHandler.save(System.out);
      

      results in

      <?xml version="1.0"?>
      <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
      <plist version="1.0">
          <dict>
              <key>things</key>
              <string>chair</string>
      
              <key>things</key>
              <string>hat</string>
      
              <key>things</key>
              <string>door</string>
          </dict>
      </plist>
      

      expecting

      <?xml version="1.0"?>
      <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
      <plist version="1.0">
          <dict>
              <key>things</key>
              <array>
                <string>chair</string>
                <string>hat</string>
                <string>door</string>
            </array>
          </dict>
      </plist>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ggregory Gary D. Gregory
                Reporter:
                steinybot Jason Pickens
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: