This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new 6f4b19516b Prevent deadlock in Jackson (#10379)
6f4b19516b is described below

commit 6f4b19516bc1cc4d4a89fd2018b918b6f7e6d625
Author: Robert Stupp <[email protected]>
AuthorDate: Mon May 27 16:21:56 2024 +0200

    Prevent deadlock in Jackson (#10379)
    
    Following warning is always printed when using Iceberg REST clients:
    ```
    PropertyNamingStrategy.KebabCaseStrategy is used but it has been deprecated 
due to risk of deadlock. Consider using 
PropertyNamingStrategies.KebabCaseStrategy instead. See 
https://github.com/FasterXML/jackson-databind/issues/2715 for more details.
    ```
---
 .../main/java/org/apache/iceberg/aws/s3/signer/S3ObjectMapper.java    | 4 ++--
 core/src/main/java/org/apache/iceberg/rest/RESTObjectMapper.java      | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3ObjectMapper.java 
b/aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3ObjectMapper.java
index b763c9aceb..89145b2465 100644
--- a/aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3ObjectMapper.java
+++ b/aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3ObjectMapper.java
@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.JsonDeserializer;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.JsonSerializer;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
 import com.fasterxml.jackson.databind.SerializerProvider;
 import com.fasterxml.jackson.databind.module.SimpleModule;
 import java.io.IOException;
@@ -57,7 +57,7 @@ public class S3ObjectMapper {
           // even though using new PropertyNamingStrategy.KebabCaseStrategy() 
is deprecated
           // and PropertyNamingStrategies.KebabCaseStrategy.INSTANCE 
(introduced in jackson 2.14) is
           // recommended, we can't use it because Spark still relies on 
jackson 2.13.x stuff
-          MAPPER.setPropertyNamingStrategy(new 
PropertyNamingStrategy.KebabCaseStrategy());
+          MAPPER.setPropertyNamingStrategy(new 
PropertyNamingStrategies.KebabCaseStrategy());
           MAPPER.registerModule(initModule());
           isInitialized = true;
         }
diff --git a/core/src/main/java/org/apache/iceberg/rest/RESTObjectMapper.java 
b/core/src/main/java/org/apache/iceberg/rest/RESTObjectMapper.java
index f9572b227d..36ed10916a 100644
--- a/core/src/main/java/org/apache/iceberg/rest/RESTObjectMapper.java
+++ b/core/src/main/java/org/apache/iceberg/rest/RESTObjectMapper.java
@@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.PropertyAccessor;
 import com.fasterxml.jackson.core.JsonFactory;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
 
 class RESTObjectMapper {
   private static final JsonFactory FACTORY = new JsonFactory();
@@ -38,7 +38,7 @@ class RESTObjectMapper {
         if (!isInitialized) {
           MAPPER.setVisibility(PropertyAccessor.FIELD, 
JsonAutoDetect.Visibility.ANY);
           MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, 
false);
-          MAPPER.setPropertyNamingStrategy(new 
PropertyNamingStrategy.KebabCaseStrategy());
+          MAPPER.setPropertyNamingStrategy(new 
PropertyNamingStrategies.KebabCaseStrategy());
           RESTSerializers.registerAll(MAPPER);
           isInitialized = true;
         }

Reply via email to