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 35442] - [configuration] MapConfiguration does not decode escaped Delimiters
Date Mon, 12 Feb 2007 11:38:22 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=35442>.
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=35442


mpolak@email.cz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |




------- Additional Comments From mpolak@email.cz  2007-02-12 03:38 -------
Hi, I would like to reopen this bug, because IMHO it still exists in
commons-configuration-1.2.jar. :-)

Behaviour of --code-sample-- originally posted by Martin Treusch von Buttlar is
same as mine.
Problematic code (MapConfiguration.getProperty) :

List list = PropertyConverter.split((String) value, getDelimiter());
return list.size() > 1 ? list : value;

Variable 'value' still contains backslashes as escape chars.
Backslashes are removed by PropertyConverter.split
I think same bugs are in:

AppletConfiguration.getProperty
ServletConfiguration.getProperty
ServletContextConfiguration.getProperty
ServletFilterConfiguration.getProperty

Property and XML configuration are OK, I think.

Resolve proposal:
public Object getProperty(String key)
    {
        Object value = map.get(key);
        if (value instanceof String)
        {
            List list = PropertyConverter.split((String) value, getDelimiter());
            //Bad code:
            //return list.size() > 1 ? list : value;
            //MP: value still contains backslashes as escape chars.
            //So correction is very easy:
            return list.size() > 1 ? list : list.get(0);
        }
        else
        {
            return value;
        }
    }

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