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=30799>.
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=30799

[configuration] Set wrong property when call XMLConfiguration.setProperty





------- Additional Comments From [EMAIL PROTECTED]  2004-09-28 12:08 -------
I can reproduce with this code:

/*
 * Copyright 2001-2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License")
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.commons.configuration;

import java.io.File;


/**
 * test for loading and saving xml properties files
 *
 * @version $Id: TestXMLConfiguration.java,v 1.11 2004/09/22 17:17:30 ebourg Exp $
 */
public class TestCfg 
{
    /** The File that we test with */
    private static String testProperties = new
File("conf/ckfr_test.xml").getAbsolutePath();
    private static String testBasePath = new File("conf").getAbsolutePath();
    private static File testSaveConf = new File("target/ckfr_save.xml");

    static XMLConfiguration conf;

    public static void main(String[] args) throws Exception
    {
        conf = new XMLConfiguration(new File(testProperties));
                conf.addProperty("a.key2", "value2");
                conf.save(testSaveConf);
                conf.setProperty("a.key1", "abcdefgh");
                conf.save(testSaveConf); 
    }
}

and this starting file:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<a>
</a>
</configuration>

Can anyone else reproduce? Some logging statements:

INFO  [main]
org.apache.commons.configuration.XMLConfiguration.addXmlProperty(XMLConfiguration.java:478)
- Created element: [[key1: null]], appending to parent [[a: null]]
INFO  [main]
org.apache.commons.configuration.XMLConfiguration.addXmlProperty(XMLConfiguration.java:483)
- Appending text [abcdefgh] to child
INFO  [main]
org.apache.commons.configuration.XMLConfiguration.setXmlProperty(XMLConfiguration.java:418)
- Appending abcdefgh to [key1: null]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to