Skip to content

Commit

Permalink
Update release notes wrt #445, move test from failing to non-failing
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 27, 2021
1 parent 51889d0 commit f199076
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 39 deletions.
5 changes: 4 additions & 1 deletion release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ Migwel@github
* Contributed #360: Add a feature to support writing `xsi:nil` attribute for
`null` values
(2.12.0)

* Contributed fix for #445: `XmlMapper`/`UntypedObjectDeserializer` mixes
multiple unwrapped collections
(2.12.2)

Ingo Wiarda (dewarim@github)

* Reported #374: Deserialization fails with `XmlMapper` and
Expand Down
5 changes: 5 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Project: jackson-dataformat-xml
=== Releases ===
------------------------------------------------------------------------

2.12.2 (not yet released)

#445: `XmlMapper`/`UntypedObjectDeserializer` mixes multiple unwrapped collections
(fix contributed by Migwel@github)

2.12.1 (08-Jan-2021)

#435: After upgrade to 2.12.0, NPE when deserializing an empty element to `ArrayList`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.fasterxml.jackson.dataformat.xml.deser;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
Expand Down Expand Up @@ -81,4 +85,25 @@ public void testMixedContent() throws Exception
fail("Expected:\n"+w.writeValueAsString(exp)+"\ngot:\n"+w.writeValueAsString(fromXml));
}
}

// [dataformat-xml#445]: problem with earlier #205 implementation (from 2.12.0),
// fixed in 2.12.2
public void testDuplicateListDeser445() throws Exception
{
final String XML =
"<person>\n" +
" <name>a</name>\n" +
" <name>b</name>\n" +
" <surname>c</surname>\n" +
" <surname>d</surname>\n" +
"</person>";
@SuppressWarnings("unchecked")
Map<String, List<String>> person = (Map<String, List<String>>) XML_MAPPER.readValue(XML, Object.class);
List<String> names = person.get("name");
List<String> surnames = person.get("surname");
assertEquals(2, names.size());
assertEquals(Arrays.asList("a", "b"), names);
assertEquals(2, surnames.size());
assertEquals(Arrays.asList("c", "d"), surnames);
}
}

This file was deleted.

0 comments on commit f199076

Please sign in to comment.