Skip to content

Commit

Permalink
upgrade jackson to 2.16.x, remove deprecated JsonNodeFactory.withExac…
Browse files Browse the repository at this point in the history
…tBigDecimals

apache#13662
  • Loading branch information
showuon committed Jul 18, 2024
1 parent 83c47ae commit 36c09f1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public class JsonConverter implements Converter, HeaderConverter {
// names specified in the field
private static final HashMap<String, LogicalTypeConverter> LOGICAL_CONVERTERS = new HashMap<>();

private static final JsonNodeFactory JSON_NODE_FACTORY = JsonNodeFactory.withExactBigDecimals(true);
private static final JsonNodeFactory JSON_NODE_FACTORY = new JsonNodeFactory(true);

static {
LOGICAL_CONVERTERS.put(Decimal.LOGICAL_NAME, new LogicalTypeConverter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class JsonDeserializer implements Deserializer<JsonNode> {
* Default constructor needed by Kafka
*/
public JsonDeserializer() {
this(Collections.emptySet(), JsonNodeFactory.withExactBigDecimals(true));
this(Collections.emptySet(), new JsonNodeFactory(true));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class JsonSerializer implements Serializer<JsonNode> {
* Default constructor needed by Kafka
*/
public JsonSerializer() {
this(Collections.emptySet(), JsonNodeFactory.withExactBigDecimals(true));
this(Collections.emptySet(), new JsonNodeFactory(true));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TimeZone;

Expand All @@ -64,7 +65,7 @@ public class JsonConverterTest {

private final ObjectMapper objectMapper = new ObjectMapper()
.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)
.setNodeFactory(JsonNodeFactory.withExactBigDecimals(true));
.setNodeFactory(new JsonNodeFactory(true));

private final JsonConverter converter = new JsonConverter();

Expand Down Expand Up @@ -860,7 +861,7 @@ public void testCacheSchemaToJsonConversion() {

@Test
public void testJsonSchemaCacheSizeFromConfigFile() throws URISyntaxException, IOException {
URL url = getClass().getResource("/connect-test.properties");
URL url = Objects.requireNonNull(getClass().getResource("/connect-test.properties"));
File propFile = new File(url.toURI());
String workerPropsFile = propFile.getAbsolutePath();
Map<String, String> workerProps = !workerPropsFile.isEmpty() ?
Expand Down

0 comments on commit 36c09f1

Please sign in to comment.