Skip to content

Commit

Permalink
Fix 2.x->3.x discrepancy for fix for #3450
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Apr 20, 2022
1 parent 0f55490 commit 2197e1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -762,10 +762,7 @@ protected final Integer _parseInteger(JsonParser p, DeserializationContext ctxt,
return _parseInteger(ctxt, text);
}

/**
* @since 2.14
*/
protected final Integer _parseInteger(DeserializationContext ctxt, String text) throws IOException
protected final Integer _parseInteger(DeserializationContext ctxt, String text)
{
try {
if (text.length() > 9) {
Expand Down Expand Up @@ -902,10 +899,7 @@ protected final Long _parseLong(JsonParser p, DeserializationContext ctxt,
return _parseLong(ctxt, text);
}

/**
* @since 2.14
*/
protected final Long _parseLong(DeserializationContext ctxt, String text) throws IOException
protected final Long _parseLong(DeserializationContext ctxt, String text)
{
try {
return NumberInput.parseLong(text);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
package com.fasterxml.jackson.databind.deser.filter;

import java.io.IOException;

import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.deser.DeserializationProblemHandler;
import com.fasterxml.jackson.databind.json.JsonMapper;

public class ProblemHandler3450Test extends BaseMapTest
{
// [databind#3450]

static class LenientDeserializationProblemHandler extends DeserializationProblemHandler {

@Override
public Object handleWeirdStringValue(DeserializationContext ctxt, Class<?> targetType, String valueToConvert,
String failureMsg) throws IOException {

String failureMsg)
{
// I just want to ignore badly formatted value
return null;
}
Expand All @@ -32,6 +28,7 @@ static class TestPojo3450Long {
private final ObjectMapper LENIENT_MAPPER =
JsonMapper.builder().addHandler(new LenientDeserializationProblemHandler()).build();

// [databind#3450]
public void testIntegerCoercion3450() throws Exception
{
TestPojo3450Int pojo;
Expand Down

0 comments on commit 2197e1d

Please sign in to comment.