This is an automated email from the ASF dual-hosted git repository.

menghaoran 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 abcd8a2  Remove useless groovy and gson import (#16040)
abcd8a2 is described below

commit abcd8a288f6c343c1bdf5e1a3ddea688bac959fc
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Mar 14 00:13:24 2022 +0800

    Remove useless groovy and gson import (#16040)
    
    * Revise gson usage
    
    * Remove useless groovy import
---
 pom.xml                                             | 21 ++++++++++-----------
 .../pom.xml                                         |  1 +
 .../query/DatabaseDiscoveryRuleQueryResultSet.java  |  5 +----
 .../shardingsphere-sharding-core/pom.xml            |  5 -----
 .../shardingsphere-data-pipeline-opengauss/pom.xml  |  2 ++
 .../pom.xml                                         | 10 +++++-----
 .../agent/test/metrics/MetricsPluginIT.java         |  3 +--
 .../pom.xml                                         | 21 ++++++++++++---------
 .../shardingsphere-rewrite-test/pom.xml             |  5 -----
 9 files changed, 32 insertions(+), 41 deletions(-)

diff --git a/pom.xml b/pom.xml
index a7903c9..a321493 100644
--- a/pom.xml
+++ b/pom.xml
@@ -182,6 +182,16 @@
                 <artifactId>snakeyaml</artifactId>
                 <version>${snakeyaml.version}</version>
             </dependency>
+            <dependency>
+                <groupId>com.google.code.gson</groupId>
+                <artifactId>gson</artifactId>
+                <version>${gson.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.groovy</groupId>
+                <artifactId>groovy</artifactId>
+                <version>${groovy.version}</version>
+            </dependency>
             
             <dependency>
                 <groupId>net.bytebuddy</groupId>
@@ -201,11 +211,6 @@
                 <version>${cosid.version}</version>
             </dependency>
             <dependency>
-                <groupId>com.google.code.gson</groupId>
-                <artifactId>gson</artifactId>
-                <version>${gson.version}</version>
-            </dependency>
-            <dependency>
                 <groupId>org.slf4j</groupId>
                 <artifactId>slf4j-api</artifactId>
                 <version>${slf4j.version}</version>
@@ -222,12 +227,6 @@
             </dependency>
             
             <dependency>
-                <groupId>org.apache.groovy</groupId>
-                <artifactId>groovy</artifactId>
-                <version>${groovy.version}</version>
-            </dependency>
-            
-            <dependency>
                 <groupId>org.bouncycastle</groupId>
                 <artifactId>bcprov-jdk15on</artifactId>
                 <version>${bcprov-jdk15on.version}</version>
diff --git 
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/pom.xml
 
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/pom.xml
index 8ca7bcd..c169d14 100644
--- 
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/pom.xml
+++ 
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/pom.xml
@@ -39,6 +39,7 @@
             
<artifactId>shardingsphere-db-discovery-distsql-statement</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
diff --git 
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/main/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/query/DatabaseDiscoveryRuleQueryResultSet.java
 
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/main/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/query/DatabaseDiscoveryRuleQuer
 [...]
index c91e16d..1bd3ac5 100644
--- 
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/main/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/query/DatabaseDiscoveryRuleQueryResultSet.java
+++ 
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/main/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/query/DatabaseDiscoveryRuleQueryResultSet.java
@@ -104,10 +104,7 @@ public final class DatabaseDiscoveryRuleQueryResultSet 
implements DistSQLResultS
     
     @SuppressWarnings("unchecked")
     private Map<String, String> convertToMap(final Object obj) {
-        if (null == obj) {
-            return Collections.emptyMap();
-        }
-        return new Gson().fromJson(new Gson().toJson(obj), 
LinkedHashMap.class);
+        return null == obj ? Collections.emptyMap() : new Gson().fromJson(new 
Gson().toJson(obj), LinkedHashMap.class);
     }
     
     @Override
diff --git 
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/pom.xml
 
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/pom.xml
index e5d2569..ad34d2f 100644
--- 
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/pom.xml
+++ 
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/pom.xml
@@ -116,11 +116,6 @@
         </dependency>
         
         <dependency>
-            <groupId>org.apache.groovy</groupId>
-            <artifactId>groovy</artifactId>
-        </dependency>
-        
-        <dependency>
             <groupId>me.ahoo.cosid</groupId>
             <artifactId>cosid-core</artifactId>
         </dependency>
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/pom.xml
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/pom.xml
index e0ad14e..a02cf49 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/pom.xml
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/pom.xml
@@ -34,10 +34,12 @@
             <artifactId>shardingsphere-data-pipeline-postgresql</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
         </dependency>
+        
         <dependency>
             <groupId>com.zaxxer</groupId>
             <artifactId>HikariCP</artifactId>
diff --git 
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/pom.xml
 
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/pom.xml
index d4c22a1..1235fe5 100644
--- 
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/pom.xml
+++ 
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/pom.xml
@@ -29,21 +29,21 @@
     <name>${project.artifactId}</name>
     
     <properties>
-        <gson.version>2.8.0</gson.version>
         <okhttp.version>3.7.0</okhttp.version>
     </properties>
     
     <dependencies>
         <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+        </dependency>
+        
+        <dependency>
             <groupId>com.squareup.okhttp3</groupId>
             <artifactId>okhttp</artifactId>
             <version>${okhttp.version}</version>
         </dependency>
         <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
-        </dependency>
-        <dependency>
             <groupId>com.zaxxer</groupId>
             <artifactId>HikariCP</artifactId>
             <scope>provided</scope>
diff --git 
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/java/org/apache/shardingsphere/integration/agent/test/metrics/MetricsPluginIT.java
 
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/java/org/apache/shardingsphere/integration/agent/test/metrics/MetricsPluginIT.java
index 7b1c759..b4927f5 100644
--- 
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/java/org/apache/shardingsphere/integration/agent/test/metrics/MetricsPluginIT.java
+++ 
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/java/org/apache/shardingsphere/integration/agent/test/metrics/MetricsPluginIT.java
@@ -73,8 +73,7 @@ public final class MetricsPluginIT extends BasePluginIT {
         for (String each : metricsNames) {
             String metricURL = buildMetricURL(url, each);
             try {
-                MetricResult metricResult = 
OkHttpUtils.getInstance().get(metricURL, MetricResult.class);
-                assertResult(metricResult, each);
+                assertResult(OkHttpUtils.getInstance().get(metricURL, 
MetricResult.class), each);
             } catch (final IOException ex) {
                 log.info("http get prometheus is error :", ex);
             }
diff --git 
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/pom.xml
 
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/pom.xml
index fe72f3d..451e52f 100644
--- 
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/pom.xml
+++ 
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/pom.xml
@@ -50,26 +50,29 @@
             <artifactId>shardingsphere-proxy-bootstrap</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <scope>runtime</scope>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
         </dependency>
+        
         <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
             <scope>runtime</scope>
         </dependency>
         <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
-        </dependency>
-        <dependency>
             <groupId>com.zaxxer</groupId>
             <artifactId>HikariCP</artifactId>
             <version>${hikari-cp.version}</version>
             <scope>compile</scope>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>runtime</scope>
+        </dependency>
     </dependencies>
     
     <profiles>
diff --git a/shardingsphere-test/shardingsphere-rewrite-test/pom.xml 
b/shardingsphere-test/shardingsphere-rewrite-test/pom.xml
index 5b893c4..067775d 100644
--- a/shardingsphere-test/shardingsphere-rewrite-test/pom.xml
+++ b/shardingsphere-test/shardingsphere-rewrite-test/pom.xml
@@ -85,11 +85,6 @@
         </dependency>
         
         <dependency>
-            <groupId>org.apache.groovy</groupId>
-            <artifactId>groovy</artifactId>
-        </dependency>
-        
-        <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
         </dependency>

Reply via email to