[
https://issues.apache.org/jira/browse/CONFIGURATION-366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12675577#action_12675577
]
Oliver Heger commented on CONFIGURATION-366:
--------------------------------------------
This is not a bug. In fact, the {{getKeys()}} method is now consistent with
{{containsKey()}}. In your example configuration file the key {{<XPaths>}} is
technically present in the configuration file, though it has no value. Passing
it to {{containsKeys()}} will return true. So it is only consequent if the key
is returned by the {{getKeys()}} method. Removing the {{<XPaths>}} element
should result in an empty iterator.
The change in behavior is probably related to CONFIGURATION-321. So you were
relying on a behavior of {{getKeys()}} that was considered a bug and changed in
the 1.6 release.
> XMLConfiguration.getKeys() broken
> ---------------------------------
>
> Key: CONFIGURATION-366
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-366
> Project: Commons Configuration
> Issue Type: Bug
> Components: Build
> Affects Versions: 1.6
> Environment: Java 6
> Reporter: Christian Uldall Pedersen
> Attachments: Config_1.xml, Config_2.xml, ConfigTest.java
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> XMLConfiguration.getKeys(String prefix) returns iterator with the string
> argument "prefix", when the xpath specified has no sub elements. The
> XPathExpressionEngine has been used as Expression engine.
> Version 1.3 does not have this problem. Here an empty Iterator is returned.
> This seems related to:
> http://issues.apache.org/jira/browse/CONFIGURATION-87
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.