commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tuure Laurinolli (JIRA)" <j...@apache.org>
Subject [jira] Created: (CONFIGURATION-279) PropertiesConfiguration dysfunctional if constructed with nonexistent File
Date Fri, 01 Jun 2007 12:53:15 GMT
PropertiesConfiguration dysfunctional if constructed with nonexistent File
--------------------------------------------------------------------------

                 Key: CONFIGURATION-279
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-279
             Project: Commons Configuration
          Issue Type: Bug
          Components: Events & Notifications
    Affects Versions: 1.4
            Reporter: Tuure Laurinolli


When PropertiesConfiguration is constructed around a File that does not exist, everything
seemingly goes well, but saving the configuration only results in an empty file. This differs
from constructing a PropertiesConfiguration around a file name passed as String, which appropriately
fails at construction-time, since it tries to load() the configuration, which fails.

When the nonexistent configuration file is passed as File, this does not happen, since the
File constructor in AbstractFileConfiguration specifically tests if the file exists before
calling load() and succeeds even if it wasn't called. However, if load() is not called, no
PropertiesConfigurationLayout is created or registered to the EventSource, and thus nothing
is saved when save() is called on the PropertiesConfiguration. Calling save() actually calls
getLayout(), which creates a layout and registers it, but the properties set between construction
of the PropertiesConfiguration and calling save() on it are still lost.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
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