Skip to content

Commit e5f02ff

Browse files
committed
Update release notes wrt #4121
1 parent 7d8a189 commit e5f02ff

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

release-notes/CREDITS-2.x

+4
Original file line numberDiff line numberDiff line change
@@ -1538,3 +1538,7 @@ Philippe Marschall (marschall@github)
15381538
Gili Tzabari (cowwoc@github)
15391539
* Reported #3063: `@JsonValue` fails for Java Record
15401540
(2.14.2)
1541+
1542+
Yury Molchan (yurkom@github)
1543+
* Contributed #4121: Preserve the original component type in merging to an array
1544+
(2.14.4)

release-notes/VERSION-2.x

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Project: jackson-databind
88

99
#3882: Error in creating nested `ArrayNode`s with `JsonNode.withArray()`
1010
(reported by @SaiKrishna369)
11+
#4121: Preserve the original component type in merging to an array
12+
(contributed by Yury M)
1113

1214
2.14.3 (05-May-2023)
1315

src/test/java/com/fasterxml/jackson/databind/deser/merge/ArrayMergeTest.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ static class MergedX<T>
2222
protected MergedX() { }
2323
}
2424

25-
static class Merged
25+
// [databind#4121]
26+
static class Merged4121
2627
{
2728
@JsonMerge(OptBoolean.TRUE)
2829
public Date[] value;
@@ -65,12 +66,12 @@ public void testObjectArrayMerging() throws Exception
6566
assertEquals("zap", result.value[2]);
6667
}
6768

69+
// [databind#4121]
6870
public void testComponentTypeArrayMerging() throws Exception
6971
{
70-
Merged input = new Merged();
72+
Merged4121 input = new Merged4121();
7173
input.value = new Date[] {new Date(1000L)};
72-
final JavaType type = MAPPER.getTypeFactory().constructType(new TypeReference<Merged>() {});
73-
Merged result = MAPPER.readerFor(type)
74+
Merged4121 result = MAPPER.readerFor(Merged4121.class)
7475
.withValueToUpdate(input)
7576
.readValue(a2q("{'value':[2000]}"));
7677
assertSame(input, result);
@@ -79,7 +80,7 @@ public void testComponentTypeArrayMerging() throws Exception
7980
assertEquals(2000L, result.value[1].getTime());
8081

8182
// and with one trick
82-
result = MAPPER.readerFor(type)
83+
result = MAPPER.readerFor(Merged4121.class)
8384
.with(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
8485
.withValueToUpdate(input)
8586
.readValue(a2q("{'value':3000}"));

0 commit comments

Comments
 (0)