[jira] [Commented] (CONFIGURATION-793) Error reading a list of complex objects from JSON after 2.3
[ https://issues.apache.org/jira/browse/CONFIGURATION-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17576215#comment-17576215 ] Gary D. Gregory commented on CONFIGURATION-793: --- In git master, I see that {{testGetList_nested_with_list}} passes and {{testGetList}} fails, nothing jumps out looking at the test in the debugger. Not sure why there is not a case for that. I added {{testGetList_nested_with_list}} to the test class and a new disabled test method. Thoughts from anyone? Note: You assert parameters are reversed, and the pattern is {{assertX(expected, actual)}}. > Error reading a list of complex objects from JSON after 2.3 > --- > > Key: CONFIGURATION-793 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-793 > Project: Commons Configuration > Issue Type: Bug >Affects Versions: 2.3 > Environment: JDK 11.0.4 >Reporter: Cliff Evans >Priority: Major > > We have just attempted to move from version 2.2 to 2.7 and have encountered > and issue whilst attempting to read a List from a JSON formatted > configuration file. > The issue appears to have been introduced in 2.3. > Adding the following tests to > org.apache.commons.configuration2.TestJSONConfiguration will demonstrate the > change. These tests will pass against 2.2 but fail agains 2.3 (and 2.7.) > https://issues.apache.org/jira/browse/CONFIGURATION-686 appears to have fixed > access to lists of complex objects using the dot notation for strings (see > testGetProperty_dictionaryInList() in TestJSONConfiguration) but has broken > access to the list of complex objects. > > {noformat} > @Test > public void testGetList_nested_with_list() > { > assertEquals(Arrays.asList("col1", "col2"), > jsonConfiguration.getList(String.class, "key4.key5")); > } > @Test > public void testGetList() { > final List configList = jsonConfiguration.getList(Map.class, > "capitals"); > assertEquals(configList.size(), 2); > assertEquals(configList.get(0).get("country"), "USA"); > assertEquals(configList.get(0).get("capital"), "Washington"); > assertEquals(configList.get(1).get("country"), "UK"); > assertEquals(configList.get(1).get("capital"), "London"); > } > {noformat} > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CONFIGURATION-793) Error reading a list of complex objects from JSON after 2.3
[ https://issues.apache.org/jira/browse/CONFIGURATION-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17258275#comment-17258275 ] Simon Billingsley commented on CONFIGURATION-793: - Hello, There is now a NIST CVE report on my version (2.2): [https://nvd.nist.gov/vuln/detail/CVE-2020-1953] The report recommends upgrading to at least v2.7 but I cannot do that as I am affected by this bug. > Error reading a list of complex objects from JSON after 2.3 > --- > > Key: CONFIGURATION-793 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-793 > Project: Commons Configuration > Issue Type: Bug >Affects Versions: 2.3 > Environment: JDK 11.0.4 >Reporter: Cliff Evans >Priority: Major > > We have just attempted to move from version 2.2 to 2.7 and have encountered > and issue whilst attempting to read a List from a JSON formatted > configuration file. > The issue appears to have been introduced in 2.3. > Adding the following tests to > org.apache.commons.configuration2.TestJSONConfiguration will demonstrate the > change. These tests will pass against 2.2 but fail agains 2.3 (and 2.7.) > https://issues.apache.org/jira/browse/CONFIGURATION-686 appears to have fixed > access to lists of complex objects using the dot notation for strings (see > testGetProperty_dictionaryInList() in TestJSONConfiguration) but has broken > access to the list of complex objects. > > {noformat} > @Test > public void testGetList_nested_with_list() > { > assertEquals(Arrays.asList("col1", "col2"), > jsonConfiguration.getList(String.class, "key4.key5")); > } > @Test > public void testGetList() { > final List configList = jsonConfiguration.getList(Map.class, > "capitals"); > assertEquals(configList.size(), 2); > assertEquals(configList.get(0).get("country"), "USA"); > assertEquals(configList.get(0).get("capital"), "Washington"); > assertEquals(configList.get(1).get("country"), "UK"); > assertEquals(configList.get(1).get("capital"), "London"); > } > {noformat} > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (CONFIGURATION-793) Error reading a list of complex objects from JSON after 2.3
[ https://issues.apache.org/jira/browse/CONFIGURATION-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17208846#comment-17208846 ] Cliff Evans commented on CONFIGURATION-793: --- Unfortunately, coming up with a fix looks way too complex for the time I have available. What I have been able to do though, is rework my original test to work with the test that [~oheger] added when the change that introduced the bug was done. I wouldn't be sure whether the right place for the fix would be around org.apache.commons.configuration2.AbstractYAMLBasedConfiguration#constructHierarchy, or in the code that accessed the in memory copy of the configuration. I hope that this might help zero in on the issue and lead someone more skilled than I to the correct fix for it. I've updated the main description above with this information. > Error reading a list of complex objects from JSON after 2.3 > --- > > Key: CONFIGURATION-793 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-793 > Project: Commons Configuration > Issue Type: Bug >Affects Versions: 2.3 > Environment: JDK 11.0.4 >Reporter: Cliff Evans >Priority: Major > > We have just attempted to move from version 2.2 to 2.7 and have encountered > and issue whilst attempting to read a List from a JSON formatted > configuration file. > The issue appears to have been introduced in 2.3. > Adding the following tests to > org.apache.commons.configuration2.TestJSONConfiguration will demonstrate the > change. These tests will pass against 2.2 but fail agains 2.3 (and 2.7.) > https://issues.apache.org/jira/browse/CONFIGURATION-686 appears to have fixed > access to lists of complex objects using the dot notation for strings (see > testGetProperty_dictionaryInList() in TestJSONConfiguration) but has broken > access to the list of complex objects. > > {noformat} > @Test > public void testGetList_nested_with_list() > { > assertEquals(Arrays.asList("col1", "col2"), > jsonConfiguration.getList(String.class, "key4.key5")); > } > @Test > public void testGetList() { > final List configList = jsonConfiguration.getList(Map.class, > "capitals"); > assertEquals(configList.size(), 2); > assertEquals(configList.get(0).get("country"), "USA"); > assertEquals(configList.get(0).get("capital"), "Washington"); > assertEquals(configList.get(1).get("country"), "UK"); > assertEquals(configList.get(1).get("capital"), "London"); > } > {noformat} > -- This message was sent by Atlassian Jira (v8.3.4#803005)