@@ -901,9 +901,8 @@ protected void _doAddInjectable(JacksonInject.Value injectable, AnnotatedMember
901
901
if (prev != null ) {
902
902
// 12-Apr-2017, tatu: Let's allow masking of Field by Method
903
903
if (prev .getClass () == m .getClass ()) {
904
- String type = id .getClass ().getName ();
905
- throw new IllegalArgumentException ("Duplicate injectable value with id '"
906
- + id +"' (of type " +type +")" );
904
+ reportProblem ("Duplicate injectable value with id '%s' (of type %s)" ,
905
+ id , ClassUtil .classNameOf (id ));
907
906
}
908
907
}
909
908
}
@@ -1351,12 +1350,12 @@ private PropertyNamingStrategy _findNamingStrategy()
1351
1350
if (namingDef instanceof PropertyNamingStrategy ) {
1352
1351
return (PropertyNamingStrategy ) namingDef ;
1353
1352
}
1354
- /* Alas, there's no way to force return type of "either class
1355
- * X or Y" -- need to throw an exception after the fact
1356
- */
1353
+ // Alas, there's no way to force return type of "either class
1354
+ // X or Y" -- need to throw an exception after the fact
1357
1355
if (!(namingDef instanceof Class )) {
1358
- throw new IllegalStateException ("AnnotationIntrospector returned PropertyNamingStrategy definition of type "
1359
- +namingDef .getClass ().getName ()+"; expected type PropertyNamingStrategy or Class<PropertyNamingStrategy> instead" );
1356
+ reportProblem ("AnnotationIntrospector returned PropertyNamingStrategy definition of type %s"
1357
+ + "; expected type `PropertyNamingStrategy` or `Class<PropertyNamingStrategy>` instead" ,
1358
+ ClassUtil .classNameOf (namingDef ));
1360
1359
}
1361
1360
Class <?> namingClass = (Class <?>)namingDef ;
1362
1361
// 09-Nov-2015, tatu: Need to consider pseudo-value of STD, which means "use default"
@@ -1365,8 +1364,8 @@ private PropertyNamingStrategy _findNamingStrategy()
1365
1364
}
1366
1365
1367
1366
if (!PropertyNamingStrategy .class .isAssignableFrom (namingClass )) {
1368
- throw new IllegalStateException ("AnnotationIntrospector returned Class "
1369
- + namingClass . getName ()+ "; expected Class<PropertyNamingStrategy>" );
1367
+ reportProblem ("AnnotationIntrospector returned Class %s; expected `Class<PropertyNamingStrategy>`" ,
1368
+ ClassUtil . classNameOf ( namingClass ) );
1370
1369
}
1371
1370
HandlerInstantiator hi = _config .getHandlerInstantiator ();
1372
1371
if (hi != null ) {
0 commit comments