Skip to content

Commit 38d0cc2

Browse files
committed
Bump versions of dependencies.
Also fix some deprecation warnings in modern databind.
1 parent 1cdc408 commit 38d0cc2

File tree

7 files changed

+22
-16
lines changed

7 files changed

+22
-16
lines changed

project.gradle

+16-11
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,20 @@ project.ext.description = "JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7386)
3030
* List of dependencies
3131
*/
3232
dependencies {
33-
provided(group: "com.google.code.findbugs", name: "jsr305", version: "2.0.1");
34-
compile(group: "com.github.java-json-tools", name: "jackson-coreutils", version: "1.9");
33+
provided(group: "com.google.code.findbugs", name: "jsr305", version: "3.0.2");
34+
compile(group: "com.google.guava", name: "guava", version: "28.1-android");
35+
compile(group: "com.fasterxml.jackson.core", name: "jackson-databind", version: "2.9.9");
36+
compile(group: "com.github.java-json-tools", name: "msg-simple", version: "1.2");
37+
38+
compile(group: "com.github.java-json-tools", name: "jackson-coreutils", version: "1.11");
3539
testCompile(group: "org.testng", name: "testng", version: "6.8.7") {
3640
exclude(group: "junit", module: "junit");
3741
exclude(group: "org.beanshell", module: "bsh");
3842
exclude(group: "org.yaml", module: "snakeyaml");
3943
};
40-
testCompile(group: "org.mockito", name: "mockito-core", version: "1.9.5");
41-
testCompile(group: "org.assertj", name: "assertj-core", version: "1.7.0");
44+
testCompile(group: "org.mockito", name: "mockito-core", version: "2.28.2");
45+
// FIXME: update to 3.x once we're off of Java 7
46+
testCompile(group: "org.assertj", name: "assertj-core", version: "2.9.1");
4247
}
4348

4449
javadoc.options {
@@ -48,11 +53,11 @@ javadoc.options {
4853
addStringOption("-release", "7");
4954
}
5055
links("https://docs.oracle.com/javase/7/docs/api/");
51-
links("https://www.javadoc.io/doc/com.google.code.findbugs/jsr305/3.0.1/");
52-
links("https://fasterxml.github.com/jackson-databind/javadoc/2.2.0/");
53-
links("https://fasterxml.github.com/jackson-core/javadoc/2.2.0/");
54-
links("https://fasterxml.github.com/jackson-annotations/javadoc/2.2.0/");
55-
links("https://www.javadoc.io/doc/com.google.guava/guava/16.0.1/");
56-
links("https://fge.github.io/msg-simple/");
57-
links("https://fge.github.io/jackson-coreutils/");
56+
links("https://www.javadoc.io/doc/com.google.code.findbugs/jsr305/3.0.2/");
57+
links("https://fasterxml.github.com/jackson-databind/javadoc/2.9/");
58+
links("https://fasterxml.github.com/jackson-core/javadoc/2.9/");
59+
links("https://fasterxml.github.com/jackson-annotations/javadoc/2.9/");
60+
links("https://www.javadoc.io/doc/com.google.guava/guava/28.1-android/");
61+
links("https://java-json-tools.github.io/msg-simple/");
62+
links("https://java-json-tools.github.io/jackson-coreutils/");
5863
}

src/main/java/com/github/fge/jsonpatch/AddOperation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private JsonNode addToObject(final JsonPointer path, final JsonNode node)
133133
{
134134
final JsonNode ret = node.deepCopy();
135135
final ObjectNode target = (ObjectNode) path.parent().get(ret);
136-
target.put(Iterables.getLast(path).getToken().getRaw(), value);
136+
target.set(Iterables.getLast(path).getToken().getRaw(), value);
137137
return ret;
138138
}
139139
}

src/main/java/com/github/fge/jsonpatch/JsonPatch.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public static JsonPatch fromJson(final JsonNode node)
126126
throws IOException
127127
{
128128
BUNDLE.checkNotNull(node, "jsonPatch.nullInput");
129-
return JacksonUtils.getReader().withType(JsonPatch.class)
129+
return JacksonUtils.getReader().forType(JsonPatch.class)
130130
.readValue(node);
131131
}
132132

src/main/java/com/github/fge/jsonpatch/ReplaceOperation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public JsonNode apply(final JsonNode node)
7373
final JsonNode parent = path.parent().get(ret);
7474
final String rawToken = Iterables.getLast(path).getToken().getRaw();
7575
if (parent.isObject())
76-
((ObjectNode) parent).put(rawToken, replacement);
76+
((ObjectNode) parent).replace(rawToken, replacement);
7777
else
7878
((ArrayNode) parent).set(Integer.parseInt(rawToken), replacement);
7979
return ret;

src/main/java/com/github/fge/jsonpatch/mergepatch/JsonMergePatchDeserializer.java

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public JsonMergePatch deserialize(final JsonParser jp,
9696
* not what we want.
9797
*/
9898
@Override
99+
@SuppressWarnings("deprecation")
99100
public JsonMergePatch getNullValue()
100101
{
101102
return new NonObjectMergePatch(NullNode.getInstance());

src/main/java/com/github/fge/jsonpatch/mergepatch/ObjectMergePatch.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public JsonNode apply(final JsonNode input)
8484
*/
8585
value = Optional.fromNullable(ret.get(key))
8686
.or(NullNode.getInstance());
87-
ret.put(key, entry.getValue().apply(value));
87+
ret.replace(key, entry.getValue().apply(value));
8888
}
8989

9090
ret.remove(removedMembers);

src/test/java/com/github/fge/jsonpatch/JsonPatchOperationTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected JsonPatchOperationTest(final String prefix)
5757
final JsonNode node = JsonLoader.fromResource(resource);
5858
errors = node.get("errors");
5959
ops = node.get("ops");
60-
reader = JacksonUtils.getReader().withType(JsonPatchOperation.class);
60+
reader = JacksonUtils.getReader().forType(JsonPatchOperation.class);
6161
}
6262

6363
@DataProvider

0 commit comments

Comments
 (0)