You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2019/07/02 15:11:01 UTC

[jira] [Closed] (CONFIGURATION-750) XMLPropertyListConfiguration cannot set arrays in the correct plist form

     [ https://issues.apache.org/jira/browse/CONFIGURATION-750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory closed CONFIGURATION-750.
--------------------------------------
       Resolution: Fixed
         Assignee: Gary Gregory  (was: Emmanuel Bourg)
    Fix Version/s: 2.6

In git master.

> XMLPropertyListConfiguration cannot set arrays in the correct plist form
> ------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-750
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-750
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Format
>    Affects Versions: 2.5
>            Reporter: Jason Pickens
>            Assignee: Gary Gregory
>            Priority: Minor
>             Fix For: 2.6
>
>
> This is the same as CONFIGURATION-427 except that it applies to {{setProperty}} which was missed in the original fix.
> {code:java}
> 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);
> {code}
> results in
> {code:xml}
> <?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>
> {code}
> expecting
> {code:xml}
> <?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>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)