@@ -848,7 +848,7 @@ public Calendar constructCalendar(Date d) {
848
848
/* Convenience methods for reading parsed values
849
849
/**********************************************************************
850
850
*/
851
-
851
+
852
852
/**
853
853
* Convenience method that may be used by composite or container deserializers,
854
854
* for reading one-off values for the composite type, taking into account
@@ -865,7 +865,7 @@ public <T> T readPropertyValue(JsonParser p, BeanProperty prop, JavaType type) t
865
865
if (deser == null ) {
866
866
return reportBadDefinition (type , String .format (
867
867
"Could not find JsonDeserializer for type %s (via property %s)" ,
868
- type , ClassUtil .nameOf (prop )));
868
+ ClassUtil . getTypeDescription ( type ) , ClassUtil .nameOf (prop )));
869
869
}
870
870
return (T ) deser .deserialize (p , this );
871
871
}
@@ -942,7 +942,9 @@ public Object handleWeirdKey(Class<?> keyClass, String keyValue,
942
942
}
943
943
throw weirdStringException (keyValue , keyClass , String .format (
944
944
"DeserializationProblemHandler.handleWeirdStringValue() for type %s returned value of type %s" ,
945
- keyClass , key .getClass ()));
945
+ ClassUtil .getClassDescription (keyClass ),
946
+ ClassUtil .getClassDescription (key )
947
+ ));
946
948
}
947
949
h = h .next ();
948
950
}
@@ -984,7 +986,9 @@ public Object handleWeirdStringValue(Class<?> targetClass, String value,
984
986
}
985
987
throw weirdStringException (value , targetClass , String .format (
986
988
"DeserializationProblemHandler.handleWeirdStringValue() for type %s returned value of type %s" ,
987
- targetClass , instance .getClass ()));
989
+ ClassUtil .getClassDescription (targetClass ),
990
+ ClassUtil .getClassDescription (instance )
991
+ ));
988
992
}
989
993
h = h .next ();
990
994
}
@@ -1025,7 +1029,9 @@ public Object handleWeirdNumberValue(Class<?> targetClass, Number value,
1025
1029
}
1026
1030
throw weirdNumberException (value , targetClass , _format (
1027
1031
"DeserializationProblemHandler.handleWeirdNumberValue() for type %s returned value of type %s" ,
1028
- targetClass , key .getClass ()));
1032
+ ClassUtil .getClassDescription (targetClass ),
1033
+ ClassUtil .getClassDescription (key )
1034
+ ));
1029
1035
}
1030
1036
h = h .next ();
1031
1037
}
@@ -1048,7 +1054,9 @@ public Object handleWeirdNativeValue(JavaType targetType, Object badValue,
1048
1054
}
1049
1055
throw JsonMappingException .from (p , _format (
1050
1056
"DeserializationProblemHandler.handleWeirdNativeValue() for type %s returned value of type %s" ,
1051
- targetType , goodValue .getClass ()));
1057
+ ClassUtil .getClassDescription (targetType ),
1058
+ ClassUtil .getClassDescription (goodValue )
1059
+ ));
1052
1060
}
1053
1061
}
1054
1062
throw weirdNativeValueException (badValue , raw );
@@ -1090,7 +1098,9 @@ public Object handleMissingInstantiator(Class<?> instClass, ValueInstantiator va
1090
1098
}
1091
1099
reportBadDefinition (constructType (instClass ), String .format (
1092
1100
"DeserializationProblemHandler.handleMissingInstantiator() for type %s returned value of type %s" ,
1093
- instClass , ClassUtil .classNameOf (instance )));
1101
+ ClassUtil .getClassDescription (instClass ),
1102
+ ClassUtil .getClassDescription ((instance )
1103
+ )));
1094
1104
}
1095
1105
h = h .next ();
1096
1106
}
@@ -1138,7 +1148,9 @@ public Object handleInstantiationProblem(Class<?> instClass, Object argument,
1138
1148
}
1139
1149
reportBadDefinition (constructType (instClass ), String .format (
1140
1150
"DeserializationProblemHandler.handleInstantiationProblem() for type %s returned value of type %s" ,
1141
- instClass , ClassUtil .classNameOf (instance )));
1151
+ ClassUtil .getClassDescription (instClass ),
1152
+ ClassUtil .classNameOf (instance )
1153
+ ));
1142
1154
}
1143
1155
h = h .next ();
1144
1156
}
@@ -1213,17 +1225,19 @@ public Object handleUnexpectedToken(JavaType targetType, JsonToken t,
1213
1225
}
1214
1226
reportBadDefinition (targetType , String .format (
1215
1227
"DeserializationProblemHandler.handleUnexpectedToken() for type %s returned value of type %s" ,
1216
- targetType , ClassUtil .classNameOf (instance )));
1228
+ ClassUtil .getClassDescription (targetType ),
1229
+ ClassUtil .classNameOf (instance )
1230
+ ));
1217
1231
}
1218
1232
h = h .next ();
1219
1233
}
1220
1234
if (msg == null ) {
1221
1235
if (t == null ) {
1222
1236
msg = String .format ("Unexpected end-of-input when binding data into %s" ,
1223
- targetType );
1237
+ ClassUtil . getTypeDescription ( targetType ) );
1224
1238
} else {
1225
1239
msg = String .format ("Cannot deserialize value of type %s out of %s token" ,
1226
- targetType , t );
1240
+ ClassUtil . getTypeDescription ( targetType ) , t );
1227
1241
}
1228
1242
}
1229
1243
reportInputMismatch (targetType , msg );
@@ -1264,7 +1278,8 @@ public JavaType handleUnknownTypeId(JavaType baseType, String id,
1264
1278
return type ;
1265
1279
}
1266
1280
throw invalidTypeIdException (baseType , id ,
1267
- "problem handler tried to resolve into non-subtype: " +type );
1281
+ "problem handler tried to resolve into non-subtype: " +
1282
+ ClassUtil .getTypeDescription (type ));
1268
1283
}
1269
1284
h = h .next ();
1270
1285
}
@@ -1291,7 +1306,8 @@ public JavaType handleMissingTypeId(JavaType baseType,
1291
1306
return type ;
1292
1307
}
1293
1308
throw invalidTypeIdException (baseType , null ,
1294
- "problem handler tried to resolve into non-subtype: " +type );
1309
+ "problem handler tried to resolve into non-subtype: " +
1310
+ ClassUtil .getTypeDescription (type ));
1295
1311
}
1296
1312
h = h .next ();
1297
1313
}
@@ -1316,7 +1332,8 @@ public void handleBadMerge(JsonDeserializer<?> deser) throws JsonMappingExceptio
1316
1332
{
1317
1333
if (!isEnabled (MapperFeature .IGNORE_MERGE_FOR_UNMERGEABLE )) {
1318
1334
JavaType type = constructType (deser .handledType ());
1319
- String msg = String .format ("Invalid configuration: values of type %s cannot be merged" , type );
1335
+ String msg = String .format ("Invalid configuration: values of type %s cannot be merged" ,
1336
+ ClassUtil .getTypeDescription (type ));
1320
1337
throw InvalidDefinitionException .from (getParser (), msg , type );
1321
1338
}
1322
1339
}
0 commit comments