Skip to content

Commit 8604081

Browse files
committed
Upgrade Jackson to 2.21.2
and do some related gardening, including removing inaccurate comments about using a repackaged version of Jackson (we don't).
1 parent df4cae8 commit 8604081

4 files changed

Lines changed: 23 additions & 8 deletions

File tree

couchbase-analytics-java-client/fit/src/main/java/com/couchbase/analytics/fit/performer/util/CustomDeserializer.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
1+
/*
2+
* Copyright 2023 Couchbase, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.couchbase.analytics.fit.performer.util;
218

319
import com.couchbase.analytics.client.java.codec.Deserializer;
420
import com.couchbase.analytics.client.java.codec.TypeRef;
521
import com.fasterxml.jackson.databind.json.JsonMapper;
622
import com.fasterxml.jackson.databind.node.ObjectNode;
23+
import org.jspecify.annotations.NullMarked;
724

825
import java.io.IOException;
926
import java.lang.reflect.Type;
@@ -12,6 +29,8 @@
1229
* A custom deserializer for FIT that sneakily adds a field to the result
1330
* so the driver can verify the SDK honored the request to use a custom deserializer.
1431
*/
32+
@NullMarked
33+
@SuppressWarnings("unchecked")
1534
public class CustomDeserializer implements Deserializer {
1635
private static final JsonMapper mapper = JsonMapper.builder().build();
1736

couchbase-analytics-java-client/src/main/java/com/couchbase/analytics/client/java/QueryOptions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void injectParams(ObjectNode query) {
205205
JsonObject.from(namedParameters);
206206

207207
namedParameters.forEach((key, value) -> {
208-
JsonNode jsonValue = toRepackagedJacksonNode(InternalJacksonSerDes.INSTANCE, value);
208+
JsonNode jsonValue = toJacksonNode(InternalJacksonSerDes.INSTANCE, value);
209209
if (key.charAt(0) != '$') {
210210
query.set('$' + key, jsonValue);
211211
} else {
@@ -226,7 +226,7 @@ void injectParams(ObjectNode query) {
226226
JsonObject.from(raw);
227227

228228
raw.forEach((key, value) -> {
229-
JsonNode jsonValue = toRepackagedJacksonNode(InternalJacksonSerDes.INSTANCE, value);
229+
JsonNode jsonValue = toJacksonNode(InternalJacksonSerDes.INSTANCE, value);
230230
query.set(key, jsonValue);
231231
});
232232
}
@@ -255,7 +255,7 @@ public String toString() {
255255
* This allows the user to specify query parameters as POJOs
256256
* and have them serialized using their chosen serializer.
257257
*/
258-
private static JsonNode toRepackagedJacksonNode(
258+
private static JsonNode toJacksonNode(
259259
JsonSerializer serializer,
260260
Object value
261261
) {

couchbase-analytics-java-client/src/main/java/com/couchbase/analytics/client/java/internal/InternalJacksonSerDes.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
/**
2929
* For internal SDK use only.
3030
*
31-
* @implNote The serializer is backed by a repackaged version of Jackson,
32-
* but this is an implementation detail users should not depend on.
33-
* <p>
34-
* Be aware that this serializer does not recognize standard Jackson annotations.
3531
* @see JacksonDeserializer
3632
*/
3733
public class InternalJacksonSerDes implements JsonSerializer, Deserializer {

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
<dependency>
308308
<groupId>com.fasterxml.jackson</groupId>
309309
<artifactId>jackson-bom</artifactId>
310-
<version>2.20.1</version>
310+
<version>2.21.2</version>
311311
<type>pom</type>
312312
<scope>import</scope>
313313
</dependency>

0 commit comments

Comments
 (0)