Skip to content

Commit 04d6392

Browse files
committed
Remove msgArgs
1 parent a7ea15d commit 04d6392

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/main/java/tools/jackson/databind/DeserializationContext.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,17 +1364,15 @@ public Object handleWeirdStringValue(Class<?> targetClass, String value,
13641364
* @param targetClass Type of property into which incoming String should be converted
13651365
* @param deser Type of {@link ValueDeserializer} calling this method.
13661366
* @param msg Error message template caller wants to use if exception is to be thrown
1367-
* @param msgArgs Optional arguments to use for message, if any
13681367
*
13691368
* @throws JacksonException To indicate unrecoverable problem, usually based on <code>msg</code>
13701369
*/
13711370
public Object handleNullForPrimitives(Class<?> targetClass,
1372-
ValueDeserializer<?> deser, String msg, Object... msgArgs)
1371+
ValueDeserializer<?> deser, String msg)
13731372
throws JacksonException
13741373

13751374
{
13761375
// but if not handled, just throw exception
1377-
msg = _format(msg, msgArgs);
13781376
LinkedNode<DeserializationProblemHandler> h = _config.getProblemHandlers();
13791377
while (h != null) {
13801378
// Can bail out if it's handled

src/main/java/tools/jackson/databind/deser/jdk/NumberDeserializers.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ public final T getNullValue(DeserializationContext ctxt) {
165165
// 01-Mar-2017, tatu: Alas, not all paths lead to `_coerceNull()`, as `SettableBeanProperty`
166166
// short-circuits `null` handling. Hence need this check as well.
167167
if (_primitive && ctxt.isEnabled(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)) {
168-
return (T) ctxt.handleNullForPrimitives(handledType(), this, "Cannot map `null` into type %s (set DeserializationConfig.DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES to 'false' to allow)",
169-
// Fix
170-
ClassUtil.classNameOf(handledType()));
168+
return (T) ctxt.handleNullForPrimitives(handledType(), this,
169+
String.format("Cannot map `null` into type %s (set DeserializationConfig.DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES to 'false' to allow)",
170+
ClassUtil.classNameOf(handledType())));
171171
}
172172
return _nullValue;
173173
}

src/main/java/tools/jackson/databind/deser/std/StdDeserializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,8 +1640,8 @@ protected final void _verifyNullForPrimitive(DeserializationContext ctxt)
16401640
if (ctxt.isEnabled(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)) {
16411641
ctxt.handleNullForPrimitives(handledType(),
16421642
this,
1643-
"Cannot coerce `null` to %s (disable `DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES` to allow)",
1644-
_coercedTypeDesc());
1643+
String.format("Cannot coerce `null` to %s (disable `DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES` to allow)",
1644+
_coercedTypeDesc()));
16451645
}
16461646
}
16471647

0 commit comments

Comments
 (0)