@@ -12,7 +12,7 @@ public class JsoniterSpi {
12
12
private static Config defaultConfig ;
13
13
private static List <Extension > extensions = new ArrayList <Extension >();
14
14
private static Map <Class , Class > typeImpls = new HashMap <Class , Class >();
15
- private static Map <Type , MapKeyDecoder > globalMapKeyDecoders = new HashMap <Type , MapKeyDecoder >();
15
+ private static Map <Type , Decoder > globalMapKeyDecoders = new HashMap <Type , Decoder >();
16
16
private static Map <Type , Encoder > globalMapKeyEncoders = new HashMap <Type , Encoder >();
17
17
private static Map <Type , Decoder > globalTypeDecoders = new HashMap <Type , Decoder >();
18
18
private static Map <Type , Encoder > globalTypeEncoders = new HashMap <Type , Encoder >();
@@ -28,7 +28,7 @@ protected Config initialValue() {
28
28
};
29
29
private static volatile Map <Object , String > configNames = new HashMap <Object , String >();
30
30
private static volatile Map <String , Encoder > mapKeyEncoders = new HashMap <String , Encoder >();
31
- private static volatile Map <String , MapKeyDecoder > mapKeyDecoders = new HashMap <String , MapKeyDecoder >();
31
+ private static volatile Map <String , Decoder > mapKeyDecoders = new HashMap <String , Decoder >();
32
32
private static volatile Map <String , Encoder > encoders = new HashMap <String , Encoder >();
33
33
private static volatile Map <String , Decoder > decoders = new HashMap <String , Decoder >();
34
34
private static volatile Map <Class , Extension > objectFactories = new HashMap <Class , Extension >();
@@ -98,7 +98,7 @@ public static List<Extension> getExtensions() {
98
98
return combined ;
99
99
}
100
100
101
- public static void registerMapKeyDecoder (Type mapKeyType , MapKeyDecoder mapKeyDecoder ) {
101
+ public static void registerMapKeyDecoder (Type mapKeyType , Decoder mapKeyDecoder ) {
102
102
globalMapKeyDecoders .put (mapKeyType , mapKeyDecoder );
103
103
copyGlobalMapKeyDecoder (getCurrentConfig ().configName (), mapKeyType , mapKeyDecoder );
104
104
}
@@ -159,7 +159,7 @@ public static void registerPropertyEncoder(TypeLiteral typeLiteral, String prope
159
159
// === copy from global to current ===
160
160
161
161
private static void copyGlobalSettings (String configName ) {
162
- for (Map .Entry <Type , MapKeyDecoder > entry : globalMapKeyDecoders .entrySet ()) {
162
+ for (Map .Entry <Type , Decoder > entry : globalMapKeyDecoders .entrySet ()) {
163
163
copyGlobalMapKeyDecoder (configName , entry .getKey (), entry .getValue ());
164
164
}
165
165
for (Map .Entry <Type , Encoder > entry : globalMapKeyEncoders .entrySet ()) {
@@ -196,7 +196,7 @@ private static void copyGlobalTypeDecoder(String configName, Type type, Decoder
196
196
addNewDecoder (TypeLiteral .create (type ).getDecoderCacheKey (configName ), typeDecoder );
197
197
}
198
198
199
- private static void copyGlobalMapKeyDecoder (String configName , Type mapKeyType , MapKeyDecoder mapKeyDecoder ) {
199
+ private static void copyGlobalMapKeyDecoder (String configName , Type mapKeyType , Decoder mapKeyDecoder ) {
200
200
addNewMapDecoder (TypeLiteral .create (mapKeyType ).getDecoderCacheKey (configName ), mapKeyDecoder );
201
201
}
202
202
@@ -216,13 +216,13 @@ public static String getMapKeyDecoderCacheKey(Type mapKeyType) {
216
216
217
217
// === current ===
218
218
219
- public synchronized static void addNewMapDecoder (String cacheKey , MapKeyDecoder mapKeyDecoder ) {
220
- HashMap <String , MapKeyDecoder > newCache = new HashMap <String , MapKeyDecoder >(mapKeyDecoders );
219
+ public synchronized static void addNewMapDecoder (String cacheKey , Decoder mapKeyDecoder ) {
220
+ HashMap <String , Decoder > newCache = new HashMap <String , Decoder >(mapKeyDecoders );
221
221
newCache .put (cacheKey , mapKeyDecoder );
222
222
mapKeyDecoders = newCache ;
223
223
}
224
224
225
- public static MapKeyDecoder getMapKeyDecoder (String cacheKey ) {
225
+ public static Decoder getMapKeyDecoder (String cacheKey ) {
226
226
return mapKeyDecoders .get (cacheKey );
227
227
}
228
228
0 commit comments