You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2010/01/23 17:46:17 UTC

[jira] Resolved: (CONFIGURATION-403) XMLConfiguration isEmpty has altered behaviour between 1.4 and 1.6

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

Oliver Heger resolved CONFIGURATION-403.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7

Should be fixed in subversion now (revision 902439).

I applied a slightly different solution: IMO the problem was caused by the load() method which used to assign the root node an empty text even if the XML root element had no content. So I added a condition here rather than in the isEmpty() method.

Nevertheless thank you very much for the patch and your analyis.

> XMLConfiguration isEmpty has altered behaviour between 1.4  and 1.6
> -------------------------------------------------------------------
>
>                 Key: CONFIGURATION-403
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-403
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: Windows Vista 64, JDK 1.6
>            Reporter: Daniel Berg
>            Assignee: Oliver Heger
>            Priority: Minor
>             Fix For: 1.7
>
>         Attachments: configuration-403.patch
>
>
> Given xml configuration file
> {code:xml} 
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <empty></empty>
> {code}
> {code}
> XMLConfiguration xml = new XMLConfiguration(file);
> assertTrue(xml.isEmpty());
> {code}
> isEmpty() returned true on version 1.4 ?, now it returns false, and the configuration contains a single empty string as key.
> Not sure if this should be considered a bug, but the documnetation reads: Checks if this configuration is empty. Empty means that there are no keys with any values, though there can be some (empty) nodes. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.