Skip to content

Commit 2081f9a

Browse files
dependabot[bot]RJ Lohan
authored andcommitted
Bump jackson.version from 2.9.7 to 2.10.1 (#207)
* Bump jackson.version from 2.9.7 to 2.10.1 Bumps `jackson.version` from 2.9.7 to 2.10.1. Updates `jackson-databind` from 2.9.7 to 2.10.1 - [Release notes](https://github.com/FasterXML/jackson/releases) - [Commits](https://github.com/FasterXML/jackson/commits) Updates `jackson-dataformat-cbor` from 2.9.7 to 2.10.1 - [Release notes](https://github.com/FasterXML/jackson-dataformats-binary/releases) - [Commits](FasterXML/jackson-dataformats-binary@jackson-dataformats-binary-2.9.7...jackson-dataformats-binary-2.10.1) Updates `jackson-datatype-jsr310` from 2.9.7 to 2.10.1 Updates `jackson-modules-java8` from 2.9.7 to 2.10.1 - [Release notes](https://github.com/FasterXML/jackson-modules-java8/releases) - [Commits](FasterXML/jackson-modules-java8@jackson-modules-java8-2.9.7...jackson-modules-java8-2.10.1) Signed-off-by: dependabot[bot] <[email protected]> * Fixes related to jackson-databind upgrade * Minor change to exception handling to account for behavioural change in FasterXML/jackson-databind#1675
1 parent 5f3b96b commit 2081f9a

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<awssdk.version>2.10.19</awssdk.version>
4141
<checkstyle.version>8.18</checkstyle.version>
4242
<commons-io.version>2.6</commons-io.version>
43-
<jackson.version>2.9.7</jackson.version>
43+
<jackson.version>2.10.1</jackson.version>
4444
<maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
4545
<mockito.version>2.26.0</mockito.version>
4646
<spotbugs.version>3.1.11</spotbugs.version>

src/main/java/software/amazon/cloudformation/proxy/StdCallbackContext.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.fasterxml.jackson.core.JsonToken;
2222
import com.fasterxml.jackson.databind.DeserializationContext;
2323
import com.fasterxml.jackson.databind.JsonDeserializer;
24+
import com.fasterxml.jackson.databind.JsonMappingException;
2425
import com.fasterxml.jackson.databind.JsonSerializer;
2526
import com.fasterxml.jackson.databind.SerializerProvider;
2627
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -148,7 +149,8 @@ private Map<String, Object> readMap(Class<?> type, JsonParser p, Deserialization
148149
}
149150
return value;
150151
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
151-
throw new IOException("Can not create empty map for class " + type + " @ " + p.getCurrentLocation(), e);
152+
throw new JsonMappingException(p, "Can not create empty map for class " + type + " @ " + p.getCurrentLocation(),
153+
e);
152154
}
153155
}
154156

src/main/java/software/amazon/cloudformation/resource/Serializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ public <T> String serialize(final T modelObject) throws JsonProcessingException
7878
return OBJECT_MAPPER.writeValueAsString(modelObject);
7979
}
8080

81-
public <T> T deserialize(final String s, final TypeReference<?> reference) throws IOException {
81+
public <T> T deserialize(final String s, final TypeReference<T> reference) throws IOException {
8282
return OBJECT_MAPPER.readValue(s, reference);
8383
}
8484

85-
public <T> T deserializeStrict(final String s, final TypeReference<?> reference) throws IOException {
85+
public <T> T deserializeStrict(final String s, final TypeReference<T> reference) throws IOException {
8686
return STRICT_OBJECT_MAPPER.readValue(s, reference);
8787
}
8888
}

src/test/java/software/amazon/cloudformation/proxy/StdCallackContextTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public void testIncorrectJSONException() throws IOException {
230230
parseException = (JsonParseException) exception.getCause();
231231
assertThat(parseException.getMessage()).contains("Encoded Class value not present");
232232

233-
IOException ioException = assertThrows(IOException.class, () -> {
233+
JsonMappingException ioException = assertThrows(JsonMappingException.class, () -> {
234234
String json = "{\"callGraphs\": {\"foo\": 1, \"bar\": [\"java.util.Map\", { \"1\": 2 }]}}";
235235
serializer.deserialize(json, new TypeReference<StdCallbackContext>() {
236236
});

0 commit comments

Comments
 (0)