File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/misc Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .fasterxml .jackson .datatype .jsr310 .misc ;
2+
3+ import java .time .DateTimeException ;
4+
5+ import org .junit .Test ;
6+
7+ import com .fasterxml .jackson .databind .ObjectMapper ;
8+ import com .fasterxml .jackson .datatype .jsr310 .ModuleTestBase ;
9+
10+ import static org .junit .Assert .assertEquals ;
11+
12+ public class DateTimeExceptionTest extends ModuleTestBase
13+ {
14+ private final ObjectMapper MAPPER = newMapper ();
15+
16+ // [modules-java#319]: should not fail to ser/deser DateTimeException
17+ @ Test
18+ public void testDateTimeExceptionRoundtrip () throws Exception
19+ {
20+ String json = MAPPER .writeValueAsString (new DateTimeException ("Test!" ));
21+ DateTimeException result = MAPPER .readValue (json , DateTimeException .class );
22+ assertEquals ("Test!" , result .getMessage ());
23+ }
24+ }
Original file line number Diff line number Diff line change @@ -199,3 +199,7 @@ Emanuel Trandafir (@etrandafir93)
199199 * Contribtued fix for #274 : Deserializing `java.time.Month` from an int causes an off-by-one
200200 error (`0 `-> `Jan `,`11 `-> `Dec `), because it 's an enum
201201 (2.17 .0 )
202+
203+ Ólafur Bragason (@olibraga )
204+ * Reported #319 : `java.time.DateTimeException` serialization fails
205+ (2.18 .1 )
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ Modules:
88=== Releases ===
99------------------------------------------------------------------------
1010
11+ 2.18.1 (not yet released)
12+
13+ #319 : `java.time.DateTimeException` serialization fails
14+ (repored by Ólafur B)
15+
11162.18.0 (26 -Sep-2024 )
1217
1318No changes since 2.17
You can’t perform that action at this time.
0 commit comments