Skip to content

Commit 0210c18

Browse files
committed
refactor(common): mark org.tron.json wrappers as @deprecated
1 parent 56a79b6 commit 0210c18

4 files changed

Lines changed: 21 additions & 0 deletions

File tree

common/src/main/java/org/tron/json/JSON.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212

1313
/**
1414
* Drop-in replacement for {@code com.alibaba.fastjson.JSON}.
15+
*
16+
* @deprecated Compatibility shim from the fastjson removal. New code should use
17+
* Jackson directly ({@link com.fasterxml.jackson.databind.ObjectMapper},
18+
* {@link com.fasterxml.jackson.databind.JsonNode}) instead of this helper.
1519
*/
20+
@Deprecated
1621
public final class JSON {
1722

1823
public static final ObjectMapper MAPPER = JsonMapper.builder()

common/src/main/java/org/tron/json/JSONArray.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212
/**
1313
* Drop-in replacement for {@code com.alibaba.fastjson.JSONArray}.
14+
*
15+
* @deprecated Compatibility shim from the fastjson removal. New code should use
16+
* Jackson directly ({@link com.fasterxml.jackson.databind.node.ArrayNode})
17+
* instead of this helper.
1418
*/
19+
@Deprecated
1520
public class JSONArray implements Iterable<Object> {
1621

1722
private final ArrayNode node;

common/src/main/java/org/tron/json/JSONException.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
/**
44
* Drop-in replacement for {@code com.alibaba.fastjson.JSONException}.
5+
*
6+
* @deprecated Compatibility shim from the fastjson removal. New code should
7+
* handle Jackson's own exceptions
8+
* ({@link com.fasterxml.jackson.core.JacksonException} and subclasses)
9+
* instead of this helper.
510
*/
11+
@Deprecated
612
public class JSONException extends RuntimeException {
713

814
public JSONException(String message) {

common/src/main/java/org/tron/json/JSONObject.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020
* {@link #containsKey(String)} / {@link #size()} after a null put. To emit an
2121
* explicit {@code "key":null}, pass a Jackson {@code NullNode} via
2222
* {@link #put(String, Object)}.
23+
*
24+
* @deprecated Compatibility shim from the fastjson removal. New code should use
25+
* Jackson directly ({@link com.fasterxml.jackson.databind.node.ObjectNode})
26+
* instead of this helper.
2327
*/
28+
@Deprecated
2429
public class JSONObject {
2530

2631
private final ObjectNode node;

0 commit comments

Comments
 (0)