Skip to content

Commit

Permalink
Bump jackson.version from 2.9.7 to 2.10.1 (#207)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
dependabot[bot] authored and RJ Lohan committed Nov 20, 2019
1 parent 5f3b96b commit 2081f9a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<awssdk.version>2.10.19</awssdk.version>
<checkstyle.version>8.18</checkstyle.version>
<commons-io.version>2.6</commons-io.version>
<jackson.version>2.9.7</jackson.version>
<jackson.version>2.10.1</jackson.version>
<maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
<mockito.version>2.26.0</mockito.version>
<spotbugs.version>3.1.11</spotbugs.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
Expand Down Expand Up @@ -148,7 +149,8 @@ private Map<String, Object> readMap(Class<?> type, JsonParser p, Deserialization
}
return value;
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
throw new IOException("Can not create empty map for class " + type + " @ " + p.getCurrentLocation(), e);
throw new JsonMappingException(p, "Can not create empty map for class " + type + " @ " + p.getCurrentLocation(),
e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ public <T> String serialize(final T modelObject) throws JsonProcessingException
return OBJECT_MAPPER.writeValueAsString(modelObject);
}

public <T> T deserialize(final String s, final TypeReference<?> reference) throws IOException {
public <T> T deserialize(final String s, final TypeReference<T> reference) throws IOException {
return OBJECT_MAPPER.readValue(s, reference);
}

public <T> T deserializeStrict(final String s, final TypeReference<?> reference) throws IOException {
public <T> T deserializeStrict(final String s, final TypeReference<T> reference) throws IOException {
return STRICT_OBJECT_MAPPER.readValue(s, reference);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void testIncorrectJSONException() throws IOException {
parseException = (JsonParseException) exception.getCause();
assertThat(parseException.getMessage()).contains("Encoded Class value not present");

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

0 comments on commit 2081f9a

Please sign in to comment.