Skip to content

Upgrade jackson to 2.9.5 #713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
May 23, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void testExceptionInErrorParsing() {
assertThat(decode.getMessage()).isEqualTo(
"Error 42. Failed to parse error body and deserialize exception: "
+ "Unrecognized token 'notjsonifiable': was expecting 'null', 'true', 'false' or NaN\n "
+ "at [Source: notjsonifiable!; line: 1, column: 15]. Body:\n"
+ "at [Source: (String)\"notjsonifiable!\"; line: 1, column: 15]. Body:\n"
+ "notjsonifiable!");
}

Expand Down
38 changes: 20 additions & 18 deletions error-handling/versions.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"compileClasspath": {
"com.fasterxml.jackson.core:jackson-annotations": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.fasterxml.jackson.core:jackson-databind"
"com.fasterxml.jackson.core:jackson-databind",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in 2.8 or 2.9 a lot of this stuff got renamed, no? specifically, why don't we have to update extras/jackson-support/build.gradle to reflect the new maven coordinates of the Guava and Java8 data formats?

]
},
"com.fasterxml.jackson.core:jackson-core": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.fasterxml.jackson.core:jackson-databind",
"com.fasterxml.jackson.dataformat:jackson-dataformat-cbor",
Expand All @@ -18,7 +19,7 @@
]
},
"com.fasterxml.jackson.core:jackson-databind": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.fasterxml.jackson.datatype:jackson-datatype-guava",
"com.fasterxml.jackson.datatype:jackson-datatype-jdk8",
Expand All @@ -29,31 +30,31 @@
]
},
"com.fasterxml.jackson.dataformat:jackson-dataformat-cbor": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.palantir.remoting3:jackson-support"
]
},
"com.fasterxml.jackson.datatype:jackson-datatype-guava": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.palantir.remoting3:jackson-support"
]
},
"com.fasterxml.jackson.datatype:jackson-datatype-jdk8": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.palantir.remoting3:jackson-support"
]
},
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.palantir.remoting3:jackson-support"
]
},
"com.fasterxml.jackson.module:jackson-module-afterburner": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.palantir.remoting3:jackson-support"
]
Expand Down Expand Up @@ -94,13 +95,14 @@
},
"runtime": {
"com.fasterxml.jackson.core:jackson-annotations": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.fasterxml.jackson.core:jackson-databind"
"com.fasterxml.jackson.core:jackson-databind",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
]
},
"com.fasterxml.jackson.core:jackson-core": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.fasterxml.jackson.core:jackson-databind",
"com.fasterxml.jackson.dataformat:jackson-dataformat-cbor",
Expand All @@ -111,7 +113,7 @@
]
},
"com.fasterxml.jackson.core:jackson-databind": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.fasterxml.jackson.datatype:jackson-datatype-guava",
"com.fasterxml.jackson.datatype:jackson-datatype-jdk8",
Expand All @@ -122,31 +124,31 @@
]
},
"com.fasterxml.jackson.dataformat:jackson-dataformat-cbor": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.palantir.remoting3:jackson-support"
]
},
"com.fasterxml.jackson.datatype:jackson-datatype-guava": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.palantir.remoting3:jackson-support"
]
},
"com.fasterxml.jackson.datatype:jackson-datatype-jdk8": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.palantir.remoting3:jackson-support"
]
},
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.palantir.remoting3:jackson-support"
]
},
"com.fasterxml.jackson.module:jackson-module-afterburner": {
"locked": "2.6.7",
"locked": "2.9.5",
"transitive": [
"com.palantir.remoting3:jackson-support"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public static ObjectMapper newCborServerObjectMapper() {
public static ObjectMapper withDefaultModules(ObjectMapper mapper) {
return mapper
.registerModule(new GuavaModule())
.registerModule(new ShimJdk7Module())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the only piece of non-test code that was changed then in theory if people hit sad times with the new jackson, they could conceivably force back to a lower version (and re-add this) right?

Copy link
Contributor

@j-baker j-baker May 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So for this code, there are two arguments:

  1. This code makes remoting Jackson version independent. It's why some internal projects run 2.9. So leaving it in is nice because it gives you version independence.
  2. OTOH almost everything uses Jackson 2.7+ now, and we might want to use remoting to leverage that.

.registerModule(new Jdk8Module().configureAbsentsAsNulls(true))
.registerModule(new AfterburnerModule())
.registerModule(new JavaTimeModule())
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public final class ObjectMappersTest {
@Test
public void deserializeJdk7ModuleObject() throws IOException {
String pathSeparator = File.pathSeparator;
String json = "\"" + pathSeparator + "tmp" + pathSeparator + "foo.txt\"";
String json = "\"file:///" + pathSeparator + "tmp" + pathSeparator + "foo.txt\"";

assertThat(MAPPER.readValue(json, Path.class)).isEqualTo(Paths.get(":tmp:foo.txt"));
assertThat(MAPPER.readValue(json, Path.class)).isEqualTo(Paths.get("/:tmp:foo.txt"));
}

@Test
public void serializeJdk7ModuleObject() throws JsonProcessingException {
Path path = Paths.get(":tmp:foo.txt");
assertThat(MAPPER.writeValueAsString(path)).isEqualTo("\":tmp:foo.txt\"");
Path path = Paths.get("/:tmp:foo.txt");
assertThat(MAPPER.writeValueAsString(path)).isEqualTo("\"file:///:tmp:foo.txt\"");
}

@Test
Expand Down

This file was deleted.

Loading