Skip to content

Commit b42dfc4

Browse files
committed
Merge branch '2.9' into 2.10
2 parents 0d0f01b + 323cd0b commit b42dfc4

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

release-notes/CREDITS-2.x

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -800,21 +800,26 @@ Reinhard Prechtl (dnno@github)
800800
Chetan Narsude (243826@github)
801801
* Reported #2038: JDK Serializing and using Deserialized `ObjectMapper` loses linkage
802802
back from `JsonParser.getCodec()`
803-
(2.9.6)
803+
(2.9.6)
804804
805805
Petar Tahchiev (ptahchiev@github)
806806
* Reported #2060: `UnwrappingBeanPropertyWriter` incorrectly assumes the found
807807
serializer is of type `UnwrappingBeanSerializer`
808-
(2.9.6)
808+
(2.9.6)
809+
810+
Brandon Krieger (bkrieger@github)
811+
* Reported #2064: Cannot set custom format for `SqlDateSerializer` globally
812+
(2.9.7)
809813
810814
Thibaut Robert (trobert@github)
811815
* Requested #2059: Remove `final` modifier for `TypeFactory`
812-
(2.10.0)
816+
(2.10.0)
813817
814818
Christopher Smith (chrylis@github)
815819
* Suggested #2115: Support naive deserialization of `Serializable` values as "untyped",
816820
same as `java.lang.Object`
817-
(2.10.0)
821+
(2.10.0)
818822
819823
Édouard Mercier (edouardmercier@github)
820824
* Requested #2116: Make NumberSerializers.Base public and its inherited classes not final
825+
(2.9.6)

release-notes/VERSION-2.x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Project: jackson-databind
1919
#2060: `UnwrappingBeanPropertyWriter` incorrectly assumes the found serializer is
2020
of type `UnwrappingBeanSerializer`
2121
(reported by Petar T)
22+
#2064: Cannot set custom format for `SqlDateSerializer` globally
23+
(reported by Brandon K)
2224
#2079: NPE when visiting StaticListSerializerBase
2325
(reported by WorldSEnder@github)
2426
#2082: `FactoryBasedEnumDeserializer` should be cachable

src/main/java/com/fasterxml/jackson/databind/ser/std/DateTimeSerializerBase.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ protected DateTimeSerializerBase(Class<T> type,
6262
public JsonSerializer<?> createContextual(SerializerProvider serializers,
6363
BeanProperty property) throws JsonMappingException
6464
{
65-
if (property == null) {
66-
return this;
67-
}
65+
// Note! Should not skip if `property` null since that'd skip check
66+
// for config overrides, in case of root value
6867
JsonFormat.Value format = findFormatOverrides(serializers, property, handledType());
6968
if (format == null) {
7069
return this;

src/test/java/com/fasterxml/jackson/databind/ser/jdk/SqlDateSerializationTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,14 @@ public void testPatternWithSqlDate() throws Exception
9494
assertEquals(aposToQuotes("{'dateOfBirth':'1980.04.14'}"),
9595
mapper.writeValueAsString(i));
9696
}
97+
98+
// [databind#2064]
99+
public void testSqlDateConfigOverride() throws Exception
100+
{
101+
ObjectMapper mapper = newObjectMapper();
102+
mapper.configOverride(java.sql.Date.class)
103+
.setFormat(JsonFormat.Value.forPattern("yyyy+MM+dd"));
104+
assertEquals("\"1980+04+14\"",
105+
mapper.writeValueAsString(java.sql.Date.valueOf("1980-04-14")));
106+
}
97107
}

0 commit comments

Comments
 (0)