Issue Details (XML | Word | Printable)

Key: CONFIGURATION-400
Type: Bug Bug
Status: Resolved Resolved
Resolution: Invalid
Priority: Major Major
Assignee: Oliver Heger
Reporter: Lee Naylor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Configuration

PropertiesConfiguration: Can't disable attribute splitting

Created: 20/Oct/09 07:30 PM   Updated: 21/Oct/09 07:36 PM
Return to search
Component/s: Format
Affects Version/s: 1.6
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Cloners
 

Resolution Date: 21/Oct/09 07:36 PM


 Description  « Hide
My XML configuration has the following attribute:
<some-element some-attribute=" " />

But XML Configuration is trying to split this string and trims it after splitting. I don't need this behaviour, but setting setDelimiterParsingDisabled() just changing delimeter to "|" and not disables attribute trimming.

Need either to disable trimming/splitting if setDelimiterParsingDisabled() is set to TRUE (incompatible change), or add something like setParseAttributesAsIs() that will prevent attributes to be trimmed and splitted



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Lee Naylor added a comment - 20/Oct/09 07:40 PM
I'm having the same issue as the one I cloned this issue from. The only difference is I'm using PropertiesConfiguration. I'm trying to pass in a sql query which has ',' separating the different columns i'm selecting.

my property is (all on the same line) ...
db.query = select c.ldc_cnsmr_acnt_num, (select c_p.acnt_validator from cb_cust_prev_validator c_p where c_p.customer_oid = c.oid AND c_p.acnt_validator != c.ldc_cnsmr_acnt_num AND c_p.effect_date = (select max(effect_date) from cb_cust_prev_validator c_p2 where c_p2.customer_oid = c_p.customer_oid)), c.full_name, 'P', 'ACOV', c.addr_validator, c.addr_validator, c.addr_validator from cb_customer c where c.ldc_cnsmr_acnt_num = '##account_id##'

I've tried ...
setDelimiterParsingDisabled(true);
setListDelimiter('^');

When i call isDelimiterParsingDisabled() or getListDelimiter() it shows that the attributes have been updated, but when i call getString("db.query") it always returns just "select c.ldc_cnsmr_acnt_num"


Oliver Heger added a comment - 21/Oct/09 06:08 AM
The splitting is already performed during loading, so you have to disable the delimiter parsing before you load the configuration. Afterwards it has no more effect. This is documented in the Javadocs of the setDelimiterParsingDisabled() method:

Set whether this configuration should use delimiters when parsing property values to convert them to lists of values. By default delimiter parsing is enabled Note: this change will only be effective for new parsings. If you want it to take effect for all loaded properties use the no arg constructor and call this method before setting source.

Does this solve your problem?


Lee Naylor added a comment - 21/Oct/09 05:55 PM
Yes is does!

Thanks, I obviously didn't ready the full documentation. I'll be sure to next time.


Oliver Heger added a comment - 21/Oct/09 07:36 PM
No problem. This delimiter splitting has caused us a bunch of trouble. I guess we will change this in the next major release.