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

XMLPropertyListConfiguration cannot set arrays in the correct plist form

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5
    • 2.6
    • Format
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: