Skip to content

Commit

Permalink
Merge branch '2.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 13, 2020
2 parents 818c649 + 2b0485b commit 7e21f3d
Showing 1 changed file with 10 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1173,34 +1173,6 @@ protected final void _verifyNullForPrimitiveCoercion(DeserializationContext ctxt
_reportFailedNullCoerce(ctxt, enable, feat, strDesc);
}

/*
/**********************************************************************
/* Helper methods for sub-classes, coercions, older (pre-2.12), deprecated
/**********************************************************************
*/

@Deprecated // since 2.12
protected final void _verifyNullForScalarCoercion(DeserializationContext ctxt, String str) throws JsonMappingException
{
if (!ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS)) {
String strDesc = str.isEmpty() ? "empty String (\"\")" : String.format("String \"%s\"", str);
_reportFailedNullCoerce(ctxt, true, MapperFeature.ALLOW_COERCION_OF_SCALARS, strDesc);
}
}

@Deprecated // since 2.12
protected void _verifyNumberForScalarCoercion(DeserializationContext ctxt, JsonParser p) throws IOException
{
MapperFeature feat = MapperFeature.ALLOW_COERCION_OF_SCALARS;
if (!ctxt.isEnabled(feat)) {
// 31-Mar-2017, tatu: Since we don't know (or this deep, care) about exact type,
// access as a String: may require re-encoding by parser which should be fine
String valueDesc = p.getText();
ctxt.reportInputMismatch(this, "Cannot coerce Number (%s) to %s (enable `%s.%s` to allow)",
valueDesc, _coercedTypeDesc(), feat.getClass().getSimpleName(), feat.name());
}
}

protected void _reportFailedNullCoerce(DeserializationContext ctxt, boolean state, Enum<?> feature,
String inputDesc) throws JsonMappingException
{
Expand All @@ -1215,6 +1187,8 @@ protected void _reportFailedNullCoerce(DeserializationContext ctxt, boolean stat
* on coerce failure.
*
* @return Message with backtick-enclosed name of type this deserializer supports
*
* @since 2.9
*/
protected String _coercedTypeDesc() {
boolean structured;
Expand All @@ -1236,6 +1210,14 @@ protected String _coercedTypeDesc() {
return typeDesc+" value";
}

/*
/**********************************************************************
/* Helper methods for sub-classes, coercions, older (pre-2.12), deprecated
/**********************************************************************
*/

// Removed from 3.0

/*
/**********************************************************************
/* Helper methods for sub-classes, resolving dependencies
Expand Down

0 comments on commit 7e21f3d

Please sign in to comment.