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 (Commented) (JIRA)" <ji...@apache.org> on 2012/01/19 08:26:40 UTC

[jira] [Commented] (CONFIGURATION-472) SubnodeConfigurations returned by XMLConfiguration should convert added nodes to XML nodes.

    [ https://issues.apache.org/jira/browse/CONFIGURATION-472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188972#comment-13188972 ] 

Oliver Heger commented on CONFIGURATION-472:
--------------------------------------------

I had a look at this issue, but could not reproduce it. Do you have a concrete test case which is failing?

Actually, the nodes added through {{SubnodeConfiguration}} are converted to {{XMLNode}}. This is achieved by {{SubnodeConfiguration}} overriding {{createNode()}} in a way that it delegates to its parent configuration. So in this case the new node would be created by {{XMLConfguration}} and had the correct type.

To verify that adding nodes using a {{SubnodeConfiguration}} works, I added a corresponding unit test in revision 1233218.

Please review.
                
> SubnodeConfigurations returned by XMLConfiguration should convert added nodes to XML nodes.
> -------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-472
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-472
>             Project: Commons Configuration
>          Issue Type: Improvement
>    Affects Versions: 1.7
>            Reporter: Raimund Klein
>            Priority: Minor
>
> Problem description: XMLConfiguration's configuration(s)At return regular SubnodeConfigurations which can't "really" be used for adding nodes as these won't be converted into XMLConfiguration's internal XMLNodes. More precisely, when using the SubnodeConfiguration for adding, accesses to the main XMLConfiguration can run into ClassCastExceptions later on.
> Workaround: Add the created nodes directly to the main XMLConfiguration (e.g. with the appropriate XPath), as this configuration's add methods convert these into the internal form.
> Proposed Solution: Let XMLConfiguration's configuration(s)At methods return a subclass of SubnodeConfiguration whose add methods will perform the same node conversion. Consequently, this new class' SubnodeConfigurations returned by configuration(s)At should be instances of the very same class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira