commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32797] New: - [configuration] HierarchicalXMLConfiguration.setProperty() deletes subelements
Date Wed, 22 Dec 2004 13:00:16 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32797>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32797

           Summary: [configuration]
                    HierarchicalXMLConfiguration.setProperty() deletes
                    subelements
           Product: Commons
           Version: 1.0 Final
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: Christian.Kemmer@viadee.de


Hello,

I just identified a new issue with HierarchicalXMLConfiguration. The method
setProperty does not sets a property correctly.

Try out this simple piece of code:

        Configuration myHierarchicalXMLConfig = new HierarchicalXMLConfiguration();
        Configuration myXMLConfig = new XMLConfiguration();
        myHierarchicalXMLConfig.setProperty("A.B", "valueAB");
        myHierarchicalXMLConfig.setProperty("A", "valueA");
        myXMLConfig.setProperty("A.B", "valueAB");
        myXMLConfig.setProperty("A", "valueA");
        System.out.println("myHierarchicalXMLConfig.getProperty(\"A.B\")"
                + myHierarchicalXMLConfig.getProperty("A.B"));
        System.out.println("myXMLConfig.getProperty(\"A.B\")"
                + myXMLConfig.getProperty("A.B"));


The output on my WinXP system with the 1.0 release of commons configuration
using Java 1.4.2_06 is the following:

myHierarchicalXMLConfig.getProperty("A.B")null
myXMLConfig.getProperty("A.B")valueAB

I would expect both implementations of the interface Configuration to behave the
same way. This means that also myHierarchicalXMLConfig would keep its property
"A.B" with the associated value "valueAB" after inserting the key "A".

The problem occurs in a real world scenario, if I allow my application to change
values stored in the configuration before, i.e., if I try to set a new value for
"A" after the whole configuration has been read in.
Just using XMLConfiguration instead serves as a workaround, but I cannot save a
XMLConfiguration at the moment (see solved issue 32240).

It would be nice, if this could be fixed.

Best regards,

Christian Kemmer

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message