File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
seatunnel-common/src/main/java/org/apache/seatunnel/common/utils Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ public class JsonUtils {
59
59
.configure (REQUIRE_SETTERS_FOR_GETTERS , true )
60
60
.setTimeZone (TimeZone .getDefault ());
61
61
62
+ private static final ObjectMapper DEFAULT_OBJECT_MAPPER = new ObjectMapper ();
63
+
62
64
private JsonUtils () {
63
65
throw new UnsupportedOperationException ("Construct JSONUtils" );
64
66
}
@@ -172,8 +174,8 @@ public static Map<String, String> toMap(String json) {
172
174
}
173
175
174
176
public static Map <String , Object > toMap (JsonNode jsonNode ) {
175
- ObjectMapper mapper = new ObjectMapper ();
176
- return mapper . convertValue ( jsonNode , new TypeReference <Map <String , Object >>() {});
177
+ return DEFAULT_OBJECT_MAPPER . convertValue (
178
+ jsonNode , new TypeReference <Map <String , Object >>() {});
177
179
}
178
180
179
181
/**
You can’t perform that action at this time.
0 commit comments