From 093254b2b35395f2afd797dd956a4a08fcc3ba06 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 13 Nov 2018 21:17:55 +0100 Subject: [PATCH] Jackson2ObjectMapperBuilder stores visibility declarations in order Issue: SPR-17489 --- .../http/converter/json/Jackson2ObjectMapperBuilder.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java index 695c4fb4ff..c18cb5fcc6 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java +++ b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java @@ -19,7 +19,6 @@ package org.springframework.http.converter.json; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Arrays; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; @@ -105,15 +104,15 @@ public class Jackson2ObjectMapperBuilder { private final Log logger = HttpLogging.forLogName(getClass()); - private final Map, Class> mixIns = new HashMap<>(); + private final Map, Class> mixIns = new LinkedHashMap<>(); private final Map, JsonSerializer> serializers = new LinkedHashMap<>(); private final Map, JsonDeserializer> deserializers = new LinkedHashMap<>(); - private final Map visibilities = new HashMap<>(); + private final Map visibilities = new LinkedHashMap<>(); - private final Map features = new HashMap<>(); + private final Map features = new LinkedHashMap<>(); private boolean createXmlMapper = false;