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

sunnianjun 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 1a4ab635a38 Add LITERAL_CATCH on FinalParameters for checkstyle 
(#30892)
1a4ab635a38 is described below

commit 1a4ab635a38117bcccc758861fa71294648086f0
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Apr 15 13:33:28 2024 +0800

    Add LITERAL_CATCH on FinalParameters for checkstyle (#30892)
---
 src/resources/checkstyle.xml                                          | 4 +++-
 .../test/natived/jdbc/commons/repository/OrderItemRepository.java     | 2 +-
 .../apache/shardingsphere/test/natived/jdbc/databases/MySQLTest.java  | 4 ++--
 .../shardingsphere/test/natived/jdbc/databases/OpenGaussTest.java     | 4 ++--
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/resources/checkstyle.xml b/src/resources/checkstyle.xml
index a23cfda3aa8..0cc2348d645 100644
--- a/src/resources/checkstyle.xml
+++ b/src/resources/checkstyle.xml
@@ -208,7 +208,9 @@
         <module name="AvoidEscapedUnicodeCharacters" />
         <module name="CommentsIndentation" />
         <module name="DescendantToken" />
-        <module name="FinalParameters" />
+        <module name="FinalParameters">
+            <property name="tokens" value="METHOD_DEF, CTOR_DEF, 
LITERAL_CATCH" />
+        </module>
         <module name="Indentation">
             <property name="arrayInitIndent" value="2" />
             <property name="lineWrappingIndentation" value="8" />
diff --git 
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/repository/OrderItemRepository.java
 
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/repository/OrderItemRepository.java
index c76158b5a73..f708decf509 100644
--- 
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/repository/OrderItemRepository.java
+++ 
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/repository/OrderItemRepository.java
@@ -239,7 +239,7 @@ public final class OrderItemRepository {
             connection.createStatement().executeUpdate("INSERT INTO 
t_order_item (order_id, user_id, phone, status) VALUES (2024, 2024, 
'13800000001', 'INSERT_TEST')");
             connection.createStatement().executeUpdate("INSERT INTO 
t_order_item_does_not_exist (test_id_does_not_exist) VALUES (2024)");
             connection.commit();
-        } catch (SQLException e) {
+        } catch (final SQLException ignored) {
             connection.rollback();
         } finally {
             connection.setAutoCommit(true);
diff --git 
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/MySQLTest.java
 
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/MySQLTest.java
index 32d8a373215..289ebfe0097 100644
--- 
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/MySQLTest.java
+++ 
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/MySQLTest.java
@@ -102,8 +102,8 @@ class MySQLTest {
             connection.createStatement().executeUpdate("CREATE DATABASE 
demo_ds_0;");
             connection.createStatement().executeUpdate("CREATE DATABASE 
demo_ds_1;");
             connection.createStatement().executeUpdate("CREATE DATABASE 
demo_ds_2;");
-        } catch (SQLException e) {
-            throw new RuntimeException(e);
+        } catch (final SQLException ex) {
+            throw new RuntimeException(ex);
         }
         HikariConfig config = new HikariConfig();
         
config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver");
diff --git 
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/OpenGaussTest.java
 
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/OpenGaussTest.java
index c3ba8fbd731..ac0609fba46 100644
--- 
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/OpenGaussTest.java
+++ 
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/OpenGaussTest.java
@@ -95,8 +95,8 @@ class OpenGaussTest {
             connection.createStatement().executeUpdate("CREATE DATABASE 
demo_ds_0;");
             connection.createStatement().executeUpdate("CREATE DATABASE 
demo_ds_1;");
             connection.createStatement().executeUpdate("CREATE DATABASE 
demo_ds_2;");
-        } catch (SQLException e) {
-            throw new RuntimeException(e);
+        } catch (final SQLException ex) {
+            throw new RuntimeException(ex);
         }
         HikariConfig config = new HikariConfig();
         
config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver");

Reply via email to