You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/07/06 00:48:20 UTC

DO NOT REPLY [Bug 35621] New: - Included properties w/ relative path fails in v1.1

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

           Summary: Included properties w/ relative path fails in v1.1
           Product: Commons
           Version: 1.1.0
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: mark_williams@pacbell.net


The "include" property fails in 1.1 when a PropertiesConfiguration is
instantiated with a relative path/file name instead of an absolute path, but it
works correctly in version 1.0.

As far as I can tell this bug was introduced by the refactoring of the load()
behavior from the PropertiesConfiguration constructor to the constructor of
AbstractFileConfiguration.  The load() method relies on the instance variable
"includesAllowed" which is declared and initialized in PropertiesConfiguration.
However, because in v1.1 load() is invoked from the superclass constructor, the
instance variables in the subclass have not yet been initialized when load() is
invoked. Consequently "includesAllowed" evaluates to false and the include fails.

I have attached a simple app to illustrate the issue.  It attempts to load the
property "bar" via an included properties file from the config dir.  By
manipulating the classpath in a batch script the app can be run twice, once
using version 1.0 and once using 1.1. Here is sample output:

Configuration version 1.0...
file name = myapp.properties
base path = file:/C:/myapp/config/
includes? = true
foo=foo from properties
bar=included bar


Configuration version 1.1...
file name = myapp.properties
base path = null
includes? = true
foo=foo from properties
bar=null

Note that the output contains "includes? = true" (which displays the result of
PropertiesConfiguration.getIncludesAllowed()), but this occurs after the
configuration has been completely initialized.

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