Skip to content

Commit

Permalink
use PropertyNamingStrategy's static field instead of new its subclass
Browse files Browse the repository at this point in the history
bypass the potential deadlock when PropertyNamingStrategy class initialization
see: FasterXML/jackson-databind#2715
  • Loading branch information
fangwentong committed May 9, 2020
1 parent 927fece commit 92eb162
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class AsynchronousAgentDispatcher {
private AsynchronousAgentDispatcher() {
this.writer = new ObjectMapper()
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.setPropertyNamingStrategy(new PropertyNamingStrategy.PascalCaseStrategy())
.setPropertyNamingStrategy(PropertyNamingStrategy.PASCAL_CASE_TO_CAMEL_CASE)
.writer();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy.PascalCaseStrategy;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;

/**
* Unmarshaller for JSON error responses from AWS services.
Expand All @@ -34,7 +34,7 @@ public class JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> {

private static final ObjectMapper MAPPER = new ObjectMapper().configure(
DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false).setPropertyNamingStrategy(
new PascalCaseStrategy());
PropertyNamingStrategy.PASCAL_CASE_TO_CAMEL_CASE);

private final String handledErrorCode;

Expand Down

0 comments on commit 92eb162

Please sign in to comment.