You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Scott Wells (JIRA)" <ji...@apache.org> on 2008/10/22 17:43:44 UTC
[jira] Commented: (CONFIGURATION-342) DatabaseConfiguration.copy()
loses list/array values
[ https://issues.apache.org/jira/browse/CONFIGURATION-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641890#action_12641890 ]
Scott Wells commented on CONFIGURATION-342:
-------------------------------------------
After a little more debugging, it looks like it may be worse than just copy. I just tried to add the list directly and it still only picked up the first element. So basically the following:
DatabaseConfiguration dc = new DatabaseConfiguration(...);
dc.addProperty("myList", Arrays.asList("1", "2", "3", "4");
List list = dc.getList("myList");
// At this point, you'll get a single element list containing only "1"
Scanning the bug DB, it looks like there was a problem earlier with this. Perhaps a regression? Or (hopefully!) I'm doing something wrong? I haven't changed the delimiter or whether it should be evaluated from the defaults for a new DBConfig.
> DatabaseConfiguration.copy() loses list/array values
> ----------------------------------------------------
>
> Key: CONFIGURATION-342
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-342
> Project: Commons Configuration
> Issue Type: Bug
> Components: Type conversion
> Affects Versions: 1.5
> Reporter: Scott Wells
>
> I've found a bug where adding a list property to a BaseConfiguration, then copying that full BaseConfiguration to a DatabaseConfiguration, the list is lost and only the first element is copied to the destination DatabaseConfiguration. For example:
> BaseConfiguration bc = new BaseConfiguration();
> bc.addProperty("myList", Arrays.asList("1", "2", "3", "4");
> DatabaseConfiguration dc = new DatabaseConfiguration(...);
> dc.copy(bc);
> List list = dc.getList("myList");
> // At this point, you'll get a single element list containing only "1"
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.