@@ -13,7 +13,7 @@ public class JsoniterSpi {
1313 private static List <Extension > extensions = new ArrayList <Extension >();
1414 private static Map <Class , Class > typeImpls = new HashMap <Class , Class >();
1515 private static Map <Type , MapKeyDecoder > globalMapKeyDecoders = new HashMap <Type , MapKeyDecoder >();
16- private static Map <Type , MapKeyEncoder > globalMapKeyEncoders = new HashMap <Type , MapKeyEncoder >();
16+ private static Map <Type , Encoder > globalMapKeyEncoders = new HashMap <Type , Encoder >();
1717 private static Map <Type , Decoder > globalTypeDecoders = new HashMap <Type , Decoder >();
1818 private static Map <Type , Encoder > globalTypeEncoders = new HashMap <Type , Encoder >();
1919 private static Map <TypeProperty , Decoder > globalPropertyDecoders = new HashMap <TypeProperty , Decoder >();
@@ -27,7 +27,7 @@ protected Config initialValue() {
2727 }
2828 };
2929 private static volatile Map <Object , String > configNames = new HashMap <Object , String >();
30- private static volatile Map <String , MapKeyEncoder > mapKeyEncoders = new HashMap <String , MapKeyEncoder >();
30+ private static volatile Map <String , Encoder > mapKeyEncoders = new HashMap <String , Encoder >();
3131 private static volatile Map <String , MapKeyDecoder > mapKeyDecoders = new HashMap <String , MapKeyDecoder >();
3232 private static volatile Map <String , Encoder > encoders = new HashMap <String , Encoder >();
3333 private static volatile Map <String , Decoder > decoders = new HashMap <String , Decoder >();
@@ -103,7 +103,7 @@ public static void registerMapKeyDecoder(Type mapKeyType, MapKeyDecoder mapKeyDe
103103 copyGlobalMapKeyDecoder (getCurrentConfig ().configName (), mapKeyType , mapKeyDecoder );
104104 }
105105
106- public static void registerMapKeyEncoder (Type mapKeyType , MapKeyEncoder mapKeyEncoder ) {
106+ public static void registerMapKeyEncoder (Type mapKeyType , Encoder mapKeyEncoder ) {
107107 globalMapKeyEncoders .put (mapKeyType , mapKeyEncoder );
108108 copyGlobalMapKeyEncoder (getCurrentConfig ().configName (), mapKeyType , mapKeyEncoder );
109109 }
@@ -162,7 +162,7 @@ private static void copyGlobalSettings(String configName) {
162162 for (Map .Entry <Type , MapKeyDecoder > entry : globalMapKeyDecoders .entrySet ()) {
163163 copyGlobalMapKeyDecoder (configName , entry .getKey (), entry .getValue ());
164164 }
165- for (Map .Entry <Type , MapKeyEncoder > entry : globalMapKeyEncoders .entrySet ()) {
165+ for (Map .Entry <Type , Encoder > entry : globalMapKeyEncoders .entrySet ()) {
166166 copyGlobalMapKeyEncoder (configName , entry .getKey (), entry .getValue ());
167167 }
168168 for (Map .Entry <Type , Decoder > entry : globalTypeDecoders .entrySet ()) {
@@ -200,7 +200,7 @@ private static void copyGlobalMapKeyDecoder(String configName, Type mapKeyType,
200200 addNewMapDecoder (TypeLiteral .create (mapKeyType ).getDecoderCacheKey (configName ), mapKeyDecoder );
201201 }
202202
203- private static void copyGlobalMapKeyEncoder (String configName , Type mapKeyType , MapKeyEncoder mapKeyEncoder ) {
203+ private static void copyGlobalMapKeyEncoder (String configName , Type mapKeyType , Encoder mapKeyEncoder ) {
204204 addNewMapEncoder (TypeLiteral .create (mapKeyType ).getEncoderCacheKey (configName ), mapKeyEncoder );
205205 }
206206
@@ -226,13 +226,13 @@ public static MapKeyDecoder getMapKeyDecoder(String cacheKey) {
226226 return mapKeyDecoders .get (cacheKey );
227227 }
228228
229- public synchronized static void addNewMapEncoder (String cacheKey , MapKeyEncoder mapKeyEncoder ) {
230- HashMap <String , MapKeyEncoder > newCache = new HashMap <String , MapKeyEncoder >(mapKeyEncoders );
229+ public synchronized static void addNewMapEncoder (String cacheKey , Encoder mapKeyEncoder ) {
230+ HashMap <String , Encoder > newCache = new HashMap <String , Encoder >(mapKeyEncoders );
231231 newCache .put (cacheKey , mapKeyEncoder );
232232 mapKeyEncoders = newCache ;
233233 }
234234
235- public static MapKeyEncoder getMapKeyEncoder (String cacheKey ) {
235+ public static Encoder getMapKeyEncoder (String cacheKey ) {
236236 return mapKeyEncoders .get (cacheKey );
237237 }
238238
0 commit comments