You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "fragfutter (JIRA)" <ji...@apache.org> on 2011/07/20 17:54:58 UTC

[jira] [Created] (CONFIGURATION-455) HierachicalINIConfiguration section access without dotted notation

HierachicalINIConfiguration section access without dotted notation
------------------------------------------------------------------

                 Key: CONFIGURATION-455
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-455
             Project: Commons Configuration
          Issue Type: Bug
          Components: Expression engine
    Affects Versions: 1.6
            Reporter: fragfutter


Setting section properties of previously non-existent Sections using getSection().setProperty() fails.

Using a non existing filename for f, the following produces an empty file.

ini = HierarchicalINIConfiguration(f)
section = ini.getSection("section")
section.setProperty("foo", "bar")
ini.save()



Accessing SubnodeConfigurations after clearing them fails.

using an existing file with an existing section, produces an empty file.

ini = new HierarchicalINIConfiguration(f);
subnode = ini.getSection("section");
if (! subnode.isEmpty() ) {
   subnode.clear();
}
subnode.setProperty("foo", "bar");
ini.save();






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

        

[jira] [Updated] (CONFIGURATION-455) HierachicalINIConfiguration section access without dotted notation

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

fragfutter updated CONFIGURATION-455:
-------------------------------------

    Attachment: BugTest.java

Bug Example

> HierachicalINIConfiguration section access without dotted notation
> ------------------------------------------------------------------
>
>                 Key: CONFIGURATION-455
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-455
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Expression engine
>    Affects Versions: 1.6
>            Reporter: fragfutter
>         Attachments: BugTest.java
>
>
> Setting section properties of previously non-existent Sections using getSection().setProperty() fails.
> Using a non existing filename for f, the following produces an empty file.
> ini = HierarchicalINIConfiguration(f)
> section = ini.getSection("section")
> section.setProperty("foo", "bar")
> ini.save()
> Accessing SubnodeConfigurations after clearing them fails.
> using an existing file with an existing section, produces an empty file.
> ini = new HierarchicalINIConfiguration(f);
> subnode = ini.getSection("section");
> if (! subnode.isEmpty() ) {
>    subnode.clear();
> }
> subnode.setProperty("foo", "bar");
> ini.save();

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

        

[jira] [Resolved] (CONFIGURATION-455) HierachicalINIConfiguration section access without dotted notation

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

Oliver Heger resolved CONFIGURATION-455.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7

A fix was applied in revision 1153643.

The getSection() method now always returns a SubnodeConfiguration which is connected to the parent configuration. Therefore changes in the section configuration are directly visible in the parent and vice versa. If the section whose name is passed to getSection() does not exist, it is newly created.

Documentation has been updated correspondingly. Also, a warning has been added that the storage scheme of the configuration should not be manipulated by calling addProperty() in an uncontrolled way.

> HierachicalINIConfiguration section access without dotted notation
> ------------------------------------------------------------------
>
>                 Key: CONFIGURATION-455
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-455
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Expression engine
>    Affects Versions: 1.6
>            Reporter: fragfutter
>             Fix For: 1.7
>
>         Attachments: BugTest.java
>
>
> Setting section properties of previously non-existent Sections using getSection().setProperty() fails.
> Using a non existing filename for f, the following produces an empty file.
> ini = HierarchicalINIConfiguration(f)
> section = ini.getSection("section")
> section.setProperty("foo", "bar")
> ini.save()
> Accessing SubnodeConfigurations after clearing them fails.
> using an existing file with an existing section, produces an empty file.
> ini = new HierarchicalINIConfiguration(f);
> subnode = ini.getSection("section");
> if (! subnode.isEmpty() ) {
>    subnode.clear();
> }
> subnode.setProperty("foo", "bar");
> ini.save();

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

        

[jira] [Commented] (CONFIGURATION-455) HierachicalINIConfiguration section access without dotted notation

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

Oliver Heger commented on CONFIGURATION-455:
--------------------------------------------

Thank you for reporting this. Hopefully I find some free cycles in a couple of days to have a look at this issue.

> HierachicalINIConfiguration section access without dotted notation
> ------------------------------------------------------------------
>
>                 Key: CONFIGURATION-455
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-455
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Expression engine
>    Affects Versions: 1.6
>            Reporter: fragfutter
>         Attachments: BugTest.java
>
>
> Setting section properties of previously non-existent Sections using getSection().setProperty() fails.
> Using a non existing filename for f, the following produces an empty file.
> ini = HierarchicalINIConfiguration(f)
> section = ini.getSection("section")
> section.setProperty("foo", "bar")
> ini.save()
> Accessing SubnodeConfigurations after clearing them fails.
> using an existing file with an existing section, produces an empty file.
> ini = new HierarchicalINIConfiguration(f);
> subnode = ini.getSection("section");
> if (! subnode.isEmpty() ) {
>    subnode.clear();
> }
> subnode.setProperty("foo", "bar");
> ini.save();

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