commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cédric Couralet <>
Subject [configuration] Unexpected trimming when value contains escaped delimiter
Date Mon, 26 May 2014 12:43:30 GMT

When parsing a property string value containing a delimiter character,
the resulting String is trimmed.
See the following example :
        BaseConfiguration conf = new BaseConfiguration();
        conf.setProperty("test1", "test\r\n");
        conf.setProperty("test2", "test\\,test");
        conf.setProperty("test3", "test\\,test\r\n");
        System.out.println("*" + conf.getString("test1") + "*");
        System.out.println("*" + conf.getString("test2") + "*");
        System.out.println("*" + conf.getString("test3") + "*");

Expected :




This is caused by the flatten method in PropertyConverter which calls
the split(value,delimiter) which results in
split(value,delimiter,true) causing the trimming.

Is there a way to disable this trimming?
I don't really know if this is expected behavior so I didn't open a
bug report, should I?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message