You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "jo desmet (JIRA)" <ji...@apache.org> on 2011/03/31 17:47:05 UTC

[jira] [Created] (CONFIGURATION-443) CombinedConfiguration getSource does not work when configuration contains ViewNodes

CombinedConfiguration getSource does not work when configuration contains ViewNodes
-----------------------------------------------------------------------------------

                 Key: CONFIGURATION-443
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-443
             Project: Commons Configuration
          Issue Type: Bug
    Affects Versions: 1.6
         Environment: windows, but should be independent
            Reporter: jo desmet


Using the getSource in the combined configuration does not work when configurations have been combined.
In that case the fetchNodeList(key) returns a viewnode which will never match on specific configuration.



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CONFIGURATION-443) CombinedConfiguration getSource does not work when configuration contains ViewNodes

Posted by "jo desmet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jo desmet updated CONFIGURATION-443:
------------------------------------

    Attachment: component1_spec.xml
                component1.xml
                SourceTest.java

> CombinedConfiguration getSource does not work when configuration contains ViewNodes
> -----------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-443
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-443
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: windows, but should be independent
>            Reporter: jo desmet
>         Attachments: SourceTest.java, component1.xml, component1_spec.xml
>
>
> Using the getSource in the combined configuration does not work when configurations have been combined.
> In that case the fetchNodeList(key) returns a viewnode which will never match on specific configuration.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CONFIGURATION-443) CombinedConfiguration getSource does not work when configuration contains ViewNodes

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger updated CONFIGURATION-443:
---------------------------------------

    Attachment: configuration-443-unittest.patch

A patch for the unit test class for CombinedConfiguration demonstrating the problem.

> CombinedConfiguration getSource does not work when configuration contains ViewNodes
> -----------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-443
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-443
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: windows, but should be independent
>            Reporter: jo desmet
>         Attachments: SourceTest.java, component1.xml, component1_spec.xml, configuration-443-unittest.patch
>
>
> Using the getSource in the combined configuration does not work when configurations have been combined.
> In that case the fetchNodeList(key) returns a viewnode which will never match on specific configuration.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CONFIGURATION-443) CombinedConfiguration getSource does not work when configuration contains ViewNodes

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016492#comment-13016492 ] 

Oliver Heger commented on CONFIGURATION-443:
--------------------------------------------

Can you give a concrete example where getSource() fails? I assume, it should work at least in *some* constellations with combined configurations; at least there are some unit tests for this scenario.

Thanks.

> CombinedConfiguration getSource does not work when configuration contains ViewNodes
> -----------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-443
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-443
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: windows, but should be independent
>            Reporter: jo desmet
>
> Using the getSource in the combined configuration does not work when configurations have been combined.
> In that case the fetchNodeList(key) returns a viewnode which will never match on specific configuration.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CONFIGURATION-443) CombinedConfiguration getSource does not work when configuration contains ViewNodes

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018546#comment-13018546 ] 

Oliver Heger commented on CONFIGURATION-443:
--------------------------------------------

Thanks for the unit test. I can now reproduce the problem.

Unfortunately, I am not sure how to fix this. If the key passed to {{getSource()}} points to a view node, the combined configuration cannot determine the source configuration on its own. The only component which has this information is the node combiner. IMHO we have the following options:
* we could either delegate the call to the combiner (which would mean extending the {{NodeCombiner}} interface - which is a binary incompatible change) or
* we could add a reference to the original node to the view node which has to be populated by the combiner.

Both options would make the code more complex, and I wonder whether it is worth the effort. Is the information about the source configuration really so important?

Maybe there is a simpler solution I just don't see?

> CombinedConfiguration getSource does not work when configuration contains ViewNodes
> -----------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-443
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-443
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: windows, but should be independent
>            Reporter: jo desmet
>         Attachments: SourceTest.java, component1.xml, component1_spec.xml
>
>
> Using the getSource in the combined configuration does not work when configurations have been combined.
> In that case the fetchNodeList(key) returns a viewnode which will never match on specific configuration.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CONFIGURATION-443) CombinedConfiguration getSource does not work when configuration contains ViewNodes

Posted by "jo desmet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016495#comment-13016495 ] 

jo desmet commented on CONFIGURATION-443:
-----------------------------------------

Hi,
indeed the issue is not always the case, I was not clear enough, sorry for that.

unittest attached, last assert fails.
The issue is only when a key is overriden, in that case the node created is a viewnode and then the fetchNodeList(key) goes wrong.
The getSource then returns the combinedconfiguration instead of the configuraton it took the key from.

Jo.

> CombinedConfiguration getSource does not work when configuration contains ViewNodes
> -----------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-443
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-443
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: windows, but should be independent
>            Reporter: jo desmet
>         Attachments: SourceTest.java, component1.xml, component1_spec.xml
>
>
> Using the getSource in the combined configuration does not work when configurations have been combined.
> In that case the fetchNodeList(key) returns a viewnode which will never match on specific configuration.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira