File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 23
23
import java .util .Locale ;
24
24
import java .util .Map ;
25
25
import java .util .Map .Entry ;
26
+ import java .util .TimeZone ;
26
27
27
28
import com .fasterxml .jackson .annotation .JsonCreator ;
28
29
import com .fasterxml .jackson .databind .Module ;
@@ -206,7 +207,16 @@ private void configureDateFormat(Jackson2ObjectMapperBuilder builder) {
206
207
(DateFormat ) BeanUtils .instantiateClass (dateFormatClass ));
207
208
}
208
209
catch (ClassNotFoundException ex ) {
209
- builder .dateFormat (new SimpleDateFormat (dateFormat ));
210
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat (dateFormat );
211
+ // Since Jackson 2.6.3 we always need to set a TimeZone (see gh-4170)
212
+ // If none in our properties fallback to the Jackson's default
213
+ TimeZone timeZone = this .jacksonProperties .getTimeZone ();
214
+ if (timeZone == null ) {
215
+ timeZone = new ObjectMapper ().getSerializationConfig ()
216
+ .getTimeZone ();
217
+ }
218
+ simpleDateFormat .setTimeZone (timeZone );
219
+ builder .dateFormat (simpleDateFormat );
210
220
}
211
221
}
212
222
}
Original file line number Diff line number Diff line change 86
86
<httpclient .version>4.5.1</httpclient .version>
87
87
<httpcore .version>4.4.4</httpcore .version>
88
88
<infinispan .version>8.0.1.Final</infinispan .version>
89
- <jackson .version>2.6.1 </jackson .version>
89
+ <jackson .version>2.6.3 </jackson .version>
90
90
<janino .version>2.7.8</janino .version>
91
91
<javassist .version>3.18.1-GA</javassist .version> <!-- Same as Hibernate -->
92
92
<javax-cache .version>1.0.0</javax-cache .version>
You can’t perform that action at this time.
0 commit comments