Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Commit

Permalink
Fix incorrect bug id in comments; fixed #25, not 24
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 18, 2013
1 parent c9cdfec commit 3f4df6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion release-notes/VERSION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Project: jackson-module-jaxb-annotations
Version: 2.3.0 (xx-xxx-2013)

#24: @XmlElementWrapper() should work wrt USE_WRAPPER_NAME_AS_PROPERTY_NAME,
#25: @XmlElementWrapper() should work wrt USE_WRAPPER_NAME_AS_PROPERTY_NAME,
use underlying "default" property name

------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ static class Bean13
public int id;
}

// [Issue#24]: should also work with 'default' name
static class Bean24
// [Issue#25]: should also work with 'default' name
static class Bean25
{
@XmlElement(name="element")
// This would work
// @XmlElementWrapper(name="values")
@XmlElementWrapper
public List<Integer> values;

public Bean24() { }
public Bean24(int... v0) {
public Bean25() { }
public Bean25(int... v0) {
values = new ArrayList<Integer>();
for (int v : v0) {
values.add(v);
Expand Down Expand Up @@ -113,18 +113,18 @@ public void testWrapperRenaming() throws Exception
assertEquals("{\"wrap\":3}", mapper.writeValueAsString(input));
}

// [Issue#24]
// [Issue#25]
public void testWrapperDefaultName() throws Exception
{
ObjectMapper mapper = getJaxbMapper();
mapper = getJaxbMapper();
mapper.enable(MapperFeature.USE_WRAPPER_NAME_AS_PROPERTY_NAME);
Bean24 input = new Bean24(1, 2, 3);
Bean25 input = new Bean25(1, 2, 3);
final String JSON = "{\"values\":[1,2,3]}";
assertEquals(JSON, mapper.writeValueAsString(input));

// plus needs to come back ok as well
Bean24 result = mapper.readValue(JSON, Bean24.class);
Bean25 result = mapper.readValue(JSON, Bean25.class);
assertNotNull(result);
assertNotNull(result.values);
assertEquals(3, result.values.size());
Expand Down

0 comments on commit 3f4df6a

Please sign in to comment.