You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2023/03/16 03:04:16 UTC
[shardingsphere] branch master updated: Add final and modify the return variable to result (#24632)
This is an automated email from the ASF dual-hosted git repository.
jianglongtao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 330ce56ddf0 Add final and modify the return variable to result (#24632)
330ce56ddf0 is described below
commit 330ce56ddf0c400597f858e9c05359b3579a55ca
Author: yx9o <ya...@163.com>
AuthorDate: Thu Mar 16 11:04:08 2023 +0800
Add final and modify the return variable to result (#24632)
* Add final and modify the return variable to result
* Update
---
.../shardingsphere/proxy/backend/util/ExportUtils.java | 4 ++--
.../shardingsphere/proxy/backend/util/JsonUtils.java | 18 +++++++++---------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/ExportUtils.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/ExportUtils.java
index c398ffaa50c..30237c86e63 100644
--- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/ExportUtils.java
+++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/ExportUtils.java
@@ -47,7 +47,7 @@ import java.util.Map.Entry;
* Export utility class.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class ExportUtils {
+public final class ExportUtils {
/**
* Export configuration data to specified file.
@@ -71,7 +71,7 @@ public class ExportUtils {
/**
* Generate configuration data of ShardingSphere database.
- *
+ *
* @param database ShardingSphere database
* @return configuration data
*/
diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/JsonUtils.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/JsonUtils.java
index 0c5e6cbcd2e..af5c8f19c81 100644
--- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/JsonUtils.java
+++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/JsonUtils.java
@@ -30,7 +30,7 @@ import lombok.SneakyThrows;
* Json utility class.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class JsonUtils {
+public final class JsonUtils {
private static final ObjectMapper MAPPER;
@@ -39,17 +39,17 @@ public class JsonUtils {
}
private static ObjectMapper initDefaultMapper() {
- ObjectMapper mapper = new ObjectMapper();
- mapper.findAndRegisterModules();
- mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
- mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
- mapper.setSerializationInclusion(Include.NON_NULL);
- return mapper;
+ ObjectMapper result = new ObjectMapper();
+ result.findAndRegisterModules();
+ result.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
+ result.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+ result.setSerializationInclusion(Include.NON_NULL);
+ return result;
}
/**
* Parse data to json string.
- *
+ *
* @param data data
* @return json string
*/
@@ -60,7 +60,7 @@ public class JsonUtils {
/**
* Deserialize to Object from json string.
- *
+ *
* @param value json string
* @param clazz target Object
* @param <T> the type of return Object data