You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by tu...@apache.org on 2022/12/24 15:38:50 UTC

[shardingsphere] branch master updated: Add final to exception. (#23087)

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

tuichenchuxin 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 9e8a5f4bdc7 Add final to exception. (#23087)
9e8a5f4bdc7 is described below

commit 9e8a5f4bdc7706151d9493bbecdd9b1a5d006dd1
Author: Raigor <ra...@gmail.com>
AuthorDate: Sat Dec 24 23:38:37 2022 +0800

    Add final to exception. (#23087)
---
 .../db/protocol/mysql/constant/MySQLCharacterSet.java               | 2 +-
 .../distsql/parser/engine/api/DistSQLStatementParserEngine.java     | 2 +-
 .../dbdiscovery/algorithm/DatabaseDiscoveryEngine.java              | 2 +-
 .../encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java      | 6 +++---
 .../condition/engine/impl/InsertClauseShardingConditionEngine.java  | 2 +-
 .../result/query/impl/driver/jdbc/type/util/ResultSetUtil.java      | 2 +-
 .../driver/jdbc/core/driver/DriverDataSourceCache.java              | 4 ++--
 .../pipeline/core/execute/ShardingSphereDataScheduleCollector.java  | 2 +-
 .../postgresql/util/PostgreSQLPipelineFreemarkerManager.java        | 2 +-
 .../java/org/apache/shardingsphere/mode/manager/ContextManager.java | 2 +-
 .../mode/repository/standalone/jdbc/JDBCRepository.java             | 2 +-
 .../handler/admin/mysql/executor/MySQLSetCharsetExecutor.java       | 2 +-
 .../backend/handler/admin/postgresql/PostgreSQLCharacterSets.java   | 2 +-
 .../backend/handler/distsql/ral/common/enums/VariableEnum.java      | 2 +-
 .../handler/distsql/ral/updatable/SetDistVariableHandler.java       | 2 +-
 .../communication/jdbc/connection/BackendConnectionTest.java        | 2 +-
 .../test/e2e/showprocesslist/engine/ShowProcessListE2EIT.java       | 2 +-
 .../org/apache/shardingsphere/test/e2e/engine/dql/BaseDQLE2EIT.java | 2 +-
 .../transaction/cases/classictransfer/ClassicTransferTestCase.java  | 2 +-
 .../e2e/transaction/cases/readonly/MySQLSetReadOnlyTestCase.java    | 2 +-
 .../transaction/cases/readonly/PostgreSQLSetReadOnlyTestCase.java   | 2 +-
 .../transaction/cases/savepoint/PostgreSQLSavePointTestCase.java    | 6 +++---
 .../e2e/transaction/cases/truncate/MySQLXATruncateTestCase.java     | 4 ++--
 .../test/it/data/pipeline/core/execute/ExecuteEngineTest.java       | 6 +++---
 24 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLCharacterSet.java b/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLCharacterSet.java
index c9c45783e19..d0100820cd1 100644
--- a/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLCharacterSet.java
+++ b/db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLCharacterSet.java
@@ -322,7 +322,7 @@ public enum MySQLCharacterSet {
         Charset result = null;
         try {
             result = charsetSupplier.get();
-        } catch (UnsupportedCharsetException ignored) {
+        } catch (final UnsupportedCharsetException ignored) {
         }
         charset = result;
     }
diff --git a/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/engine/api/DistSQLStatementParserEngine.java b/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/engine/api/DistSQLStatementParserEngine.java
index 9c9191d4c2e..3bd13c030aa 100644
--- a/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/engine/api/DistSQLStatementParserEngine.java
+++ b/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/engine/api/DistSQLStatementParserEngine.java
@@ -41,7 +41,7 @@ public final class DistSQLStatementParserEngine {
         } catch (final ParseCancellationException | SQLParsingException ignored) {
             try {
                 return new FeaturedDistSQLStatementParserEngine().parse(sql);
-            } catch (SQLParsingException ignoredToo) {
+            } catch (final SQLParsingException ignoredToo) {
                 return new UtilityDistSQLStatementParserEngine().parse(sql);
             }
         }
diff --git a/features/db-discovery/core/src/main/java/org/apache/shardingsphere/dbdiscovery/algorithm/DatabaseDiscoveryEngine.java b/features/db-discovery/core/src/main/java/org/apache/shardingsphere/dbdiscovery/algorithm/DatabaseDiscoveryEngine.java
index bc53a76569f..d3a1a16881e 100644
--- a/features/db-discovery/core/src/main/java/org/apache/shardingsphere/dbdiscovery/algorithm/DatabaseDiscoveryEngine.java
+++ b/features/db-discovery/core/src/main/java/org/apache/shardingsphere/dbdiscovery/algorithm/DatabaseDiscoveryEngine.java
@@ -119,7 +119,7 @@ public final class DatabaseDiscoveryEngine {
     private ReplicaDataSourceStatus loadReplicaStatus(final DataSource replicaDataSource) {
         try {
             return databaseDiscoveryProviderAlgorithm.loadReplicaStatus(replicaDataSource);
-        } catch (SQLException ex) {
+        } catch (final SQLException ex) {
             log.error("Load data source replica status error: ", ex);
             return new ReplicaDataSourceStatus(false, 0L);
         }
diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java
index db77286f6b2..f79f75ad675 100644
--- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java
+++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java
@@ -80,7 +80,7 @@ public final class CharDigestLikeEncryptAlgorithm implements LikeEncryptAlgorith
             String delta = props.getProperty(DELTA);
             try {
                 return Integer.parseInt(delta);
-            } catch (NumberFormatException ex) {
+            } catch (final NumberFormatException ex) {
                 throw new EncryptAlgorithmInitializationException("CHAR_DIGEST_LIKE", "delta can only be a decimal number");
             }
         }
@@ -92,7 +92,7 @@ public final class CharDigestLikeEncryptAlgorithm implements LikeEncryptAlgorith
             String mask = props.getProperty(MASK);
             try {
                 return Integer.parseInt(mask);
-            } catch (NumberFormatException ex) {
+            } catch (final NumberFormatException ex) {
                 throw new EncryptAlgorithmInitializationException("CHAR_DIGEST_LIKE", "mask can only be a decimal number");
             }
         }
@@ -104,7 +104,7 @@ public final class CharDigestLikeEncryptAlgorithm implements LikeEncryptAlgorith
             String start = props.getProperty(START);
             try {
                 return Integer.parseInt(start);
-            } catch (NumberFormatException ex) {
+            } catch (final NumberFormatException ex) {
                 throw new EncryptAlgorithmInitializationException("CHAR_DIGEST_LIKE", "start can only be a decimal number");
             }
         }
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/impl/InsertClauseShardingConditionEngine.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/impl/InsertClauseShardingConditionEngine.java
index 201677fbe8a..f910a39096f 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/impl/InsertClauseShardingConditionEngine.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/impl/InsertClauseShardingConditionEngine.java
@@ -126,7 +126,7 @@ public final class InsertClauseShardingConditionEngine implements ShardingCondit
         try {
             Integer value = Integer.valueOf(expressionSegment.getText());
             condition.getValues().add(new ListShardingConditionValue<>(shardingColumn, tableName, Collections.singletonList(value)));
-        } catch (NumberFormatException ex) {
+        } catch (final NumberFormatException ex) {
             condition.getValues().add(new ListShardingConditionValue<>(shardingColumn, tableName, Collections.singletonList(expressionSegment.getText())));
         }
     }
diff --git a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/util/ResultSetUtil.java b/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/util/ResultSetUtil.java
index 15e84aecef2..1895f263c25 100644
--- a/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/util/ResultSetUtil.java
+++ b/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/util/ResultSetUtil.java
@@ -88,7 +88,7 @@ public final class ResultSetUtil {
         }
         try {
             return convertType.cast(value);
-        } catch (ClassCastException cce) {
+        } catch (final ClassCastException ex) {
             throw new SQLFeatureNotSupportedException("getObject with type");
         }
     }
diff --git a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/DriverDataSourceCache.java b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/DriverDataSourceCache.java
index 44e7b8f2084..002ae440e62 100644
--- a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/DriverDataSourceCache.java
+++ b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/DriverDataSourceCache.java
@@ -51,8 +51,8 @@ public final class DriverDataSourceCache {
             return YamlShardingSphereDataSourceFactory.createDataSource(new ShardingSphereDriverURL(url).toConfigurationBytes());
         } catch (final IOException ex) {
             throw (T) new SQLException(ex);
-        } catch (SQLException e) {
-            throw (T) e;
+        } catch (final SQLException ex) {
+            throw (T) ex;
         }
     }
 }
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/execute/ShardingSphereDataScheduleCollector.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/execute/ShardingSphereDataScheduleCollector.java
index d23cd9887a3..397b22c1abd 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/execute/ShardingSphereDataScheduleCollector.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/execute/ShardingSphereDataScheduleCollector.java
@@ -109,7 +109,7 @@ public final class ShardingSphereDataScheduleCollector {
             Optional<ShardingSphereTableData> tableData = Optional.empty();
             try {
                 tableData = shardingSphereDataCollector.get().collect(databaseName, table, databases);
-            } catch (SQLException ex) {
+            } catch (final SQLException ex) {
                 log.error("Collect data failed!", ex);
             }
             tableData.ifPresent(shardingSphereTableData -> changedShardingSphereData.getDatabaseData().computeIfAbsent(databaseName.toLowerCase(), key -> new ShardingSphereDatabaseData())
diff --git a/kernel/data-pipeline/dialect/postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/util/PostgreSQLPipelineFreemarkerManager.java b/kernel/data-pipeline/dialect/postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/util/PostgreSQLPipelineFreemarkerManager.java
index 4abbf5d0558..a785223640b 100644
--- a/kernel/data-pipeline/dialect/postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/util/PostgreSQLPipelineFreemarkerManager.java
+++ b/kernel/data-pipeline/dialect/postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/util/PostgreSQLPipelineFreemarkerManager.java
@@ -86,7 +86,7 @@ public final class PostgreSQLPipelineFreemarkerManager {
             }
             try {
                 return TEMPLATE_CONFIG.getTemplate(String.format(pathFormat, entry.getValue()));
-            } catch (TemplateNotFoundException ignored) {
+            } catch (final TemplateNotFoundException ignored) {
             }
         }
         return TEMPLATE_CONFIG.getTemplate(String.format(pathFormat, "default"));
diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
index 98c998d1727..da64e7460b8 100644
--- a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
+++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
@@ -318,7 +318,7 @@ public final class ContextManager implements AutoCloseable {
             metaDataContexts = createMetaDataContexts(databaseName, switchingResource, ruleConfigs);
             metaDataContexts.getMetaData().getDatabases().putAll(newShardingSphereDatabase(metaDataContexts.getMetaData().getDatabase(databaseName)));
             switchingResource.closeStaleDataSources();
-        } catch (SQLException ex) {
+        } catch (final SQLException ex) {
             log.error("Alter database: {} data source and rule configuration failed", databaseName, ex);
         }
     }
diff --git a/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java b/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java
index b9e6cdbe6f8..728c1943f50 100644
--- a/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java
+++ b/mode/type/standalone/repository/provider/jdbc/core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java
@@ -169,7 +169,7 @@ public final class JDBCRepository implements StandalonePersistRepository {
             preparedStatement.setString(1, value);
             preparedStatement.setString(2, key);
             preparedStatement.executeUpdate();
-        } catch (SQLException ex) {
+        } catch (final SQLException ex) {
             log.error("Update {} data to key: {} failed", getType(), key, ex);
         }
     }
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/MySQLSetCharsetExecutor.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/MySQLSetCharsetExecutor.java
index 8949ce50ffd..edf4ff578a3 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/MySQLSetCharsetExecutor.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/MySQLSetCharsetExecutor.java
@@ -61,7 +61,7 @@ public final class MySQLSetCharsetExecutor implements MySQLSessionVariableHandle
                 try {
                     return Charset.forName(value);
                     // CHECKSTYLE:OFF
-                } catch (Exception ex) {
+                } catch (final Exception ex) {
                     // CHECKSTYLE:ON
                     throw new UnknownCharsetException(value.toLowerCase());
                 }
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/PostgreSQLCharacterSets.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/PostgreSQLCharacterSets.java
index cc1cfd31341..7a1e634e5cc 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/PostgreSQLCharacterSets.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/PostgreSQLCharacterSets.java
@@ -94,7 +94,7 @@ public enum PostgreSQLCharacterSets {
         Charset result = null;
         try {
             result = charsetSupplier.get();
-        } catch (UnsupportedCharsetException ignored) {
+        } catch (final UnsupportedCharsetException ignored) {
         }
         charset = result;
         this.aliases = aliases;
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/enums/VariableEnum.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/enums/VariableEnum.java
index cf908f73bc1..07e69b848a7 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/enums/VariableEnum.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/enums/VariableEnum.java
@@ -39,7 +39,7 @@ public enum VariableEnum {
     public static VariableEnum getValueOf(final String variableName) {
         try {
             return valueOf(variableName.toUpperCase());
-        } catch (IllegalArgumentException ex) {
+        } catch (final IllegalArgumentException ex) {
             throw new UnsupportedVariableException(variableName);
         }
     }
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableHandler.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableHandler.java
index 435bc067940..5f75878b284 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableHandler.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableHandler.java
@@ -54,7 +54,7 @@ public final class SetDistVariableHandler extends UpdatableRALBackendHandler<Set
     private Enum<?> getEnumType(final String name) {
         try {
             return ConfigurationPropertyKey.valueOf(name.toUpperCase());
-        } catch (IllegalArgumentException ex) {
+        } catch (final IllegalArgumentException ex) {
             return VariableEnum.getValueOf(name);
         }
     }
diff --git a/proxy/backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/BackendConnectionTest.java b/proxy/backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/BackendConnectionTest.java
index aa83fef1d7c..615c32e33e8 100644
--- a/proxy/backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/BackendConnectionTest.java
+++ b/proxy/backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/BackendConnectionTest.java
@@ -298,7 +298,7 @@ public final class BackendConnectionTest extends ProxyContextRestorer {
             when(proxyContext.getBackendDataSource().getConnections(anyString(), anyString(), anyInt(), any(ConnectionMode.class)))
                     .thenReturn(Collections.singletonList(connection));
             backendConnection.getConnections("", 1, ConnectionMode.CONNECTION_STRICTLY);
-        } catch (SQLException ex) {
+        } catch (final SQLException ex) {
             assertThat(ex, is(expectedException));
             verify(connection).close();
         }
diff --git a/test/e2e/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/showprocesslist/engine/ShowProcessListE2EIT.java b/test/e2e/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/showprocesslist/engine/ShowProcessListE2EIT.java
index 8c32ffbcdbb..2e2def47f9f 100644
--- a/test/e2e/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/showprocesslist/engine/ShowProcessListE2EIT.java
+++ b/test/e2e/showprocesslist/src/test/java/org/apache/shardingsphere/test/e2e/showprocesslist/engine/ShowProcessListE2EIT.java
@@ -97,7 +97,7 @@ public final class ShowProcessListE2EIT {
                     Connection connection = "proxy".equals(targetContainer) ? containerComposer.getProxyDataSource().getConnection() : containerComposer.getJdbcDataSource().getConnection();
                     Statement statement = connection.createStatement()) {
                 statement.executeQuery(SELECT_SLEEP);
-            } catch (SQLException ex) {
+            } catch (final SQLException ex) {
                 throw new RuntimeException(ex);
             }
         };
diff --git a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/dql/BaseDQLE2EIT.java b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/dql/BaseDQLE2EIT.java
index 7b87c1063e1..550d2f07576 100644
--- a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/dql/BaseDQLE2EIT.java
+++ b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/dql/BaseDQLE2EIT.java
@@ -101,7 +101,7 @@ public abstract class BaseDQLE2EIT extends SingleE2EIT {
             try {
                 assertThat(actualResultSet.getObject(i + 1), is(expectedResultSet.getObject(i + 1)));
                 assertThat(actualResultSet.getObject(actualMetaData.getColumnLabel(i + 1)), is(expectedResultSet.getObject(expectedMetaData.getColumnLabel(i + 1))));
-            } catch (AssertionError ex) {
+            } catch (final AssertionError ex) {
                 // FIXME #15593 verify accurate data types
                 Object actualValue = actualResultSet.getObject(i + 1);
                 Object expectedValue = expectedResultSet.getObject(i + 1);
diff --git a/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/classictransfer/ClassicTransferTestCase.java b/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/classictransfer/ClassicTransferTestCase.java
index 277c7ae471e..e8da3e37a4f 100644
--- a/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/classictransfer/ClassicTransferTestCase.java
+++ b/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/classictransfer/ClassicTransferTestCase.java
@@ -98,7 +98,7 @@ public final class ClassicTransferTestCase extends BaseTransactionTestCase {
                 Thread.sleep(1000);
                 statement2.execute("update account set balance = balance + 1 where transaction_id = 1;");
                 connection.commit();
-            } catch (SQLException | InterruptedException ignored) {
+            } catch (final SQLException | InterruptedException ignored) {
             }
         }
     }
diff --git a/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/readonly/MySQLSetReadOnlyTestCase.java b/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/readonly/MySQLSetReadOnlyTestCase.java
index 7b8d5930948..de2da51cdb1 100644
--- a/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/readonly/MySQLSetReadOnlyTestCase.java
+++ b/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/readonly/MySQLSetReadOnlyTestCase.java
@@ -54,7 +54,7 @@ public final class MySQLSetReadOnlyTestCase extends SetReadOnlyTestCase {
         try {
             executeWithLog(connection2, "update account set balance = 100 where id = 2;");
             fail("Update ran successfully, should failed.");
-        } catch (SQLException e) {
+        } catch (final SQLException ex) {
             log.info("Update failed for expect.");
         }
     }
diff --git a/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/readonly/PostgreSQLSetReadOnlyTestCase.java b/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/readonly/PostgreSQLSetReadOnlyTestCase.java
index cac86b2047c..f9016ecb4ab 100644
--- a/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/readonly/PostgreSQLSetReadOnlyTestCase.java
+++ b/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/readonly/PostgreSQLSetReadOnlyTestCase.java
@@ -53,7 +53,7 @@ public final class PostgreSQLSetReadOnlyTestCase extends SetReadOnlyTestCase {
         try {
             executeWithLog(connection2, "update account set balance = 100 where id = 2;");
             log.info("Using the driver of postgresql:42.4.1 expect to update successfully.");
-        } catch (SQLException e) {
+        } catch (final SQLException ex) {
             Assert.fail("Update failed, should be successfully.");
         }
     }
diff --git a/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/savepoint/PostgreSQLSavePointTestCase.java b/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/savepoint/PostgreSQLSavePointTestCase.java
index 9081bc8ea6b..64505c71503 100644
--- a/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/savepoint/PostgreSQLSavePointTestCase.java
+++ b/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/savepoint/PostgreSQLSavePointTestCase.java
@@ -55,20 +55,20 @@ public final class PostgreSQLSavePointTestCase extends BaseSavePointTestCase {
         try {
             connection.setSavepoint("point");
             fail("Expect exception, but no exception report.");
-        } catch (SQLException ex) {
+        } catch (final SQLException ex) {
             assertThat(ex.getMessage(), is("Savepoint can only be used in transaction blocks."));
         }
         try {
             connection.rollback(new PSQLSavepoint("point1"));
             fail("Expect exception, but no exception report.");
-        } catch (SQLException ex) {
+        } catch (final SQLException ex) {
             // TODO can not run to get the correct result in JDBC mode.
             assertTrue(ex.getMessage().endsWith("ERROR: ROLLBACK TO SAVEPOINT can only be used in transaction blocks"));
         }
         try {
             connection.releaseSavepoint(new PSQLSavepoint("point1"));
             fail("Expect exception, but no exception report.");
-        } catch (SQLException ex) {
+        } catch (final SQLException ex) {
             // TODO can not run to get the correct result in JDBC mode.
             assertTrue(ex.getMessage().endsWith("ERROR: RELEASE SAVEPOINT can only be used in transaction blocks"));
         }
diff --git a/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/truncate/MySQLXATruncateTestCase.java b/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/truncate/MySQLXATruncateTestCase.java
index 35b793d860d..383e324848a 100644
--- a/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/truncate/MySQLXATruncateTestCase.java
+++ b/test/e2e/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/truncate/MySQLXATruncateTestCase.java
@@ -69,9 +69,9 @@ public final class MySQLXATruncateTestCase extends BaseTransactionTestCase {
         try {
             connection.createStatement().execute("truncate account;");
             fail("Expect exception, but no exception report.");
-        } catch (TableModifyInTransactionException ex) {
+        } catch (final TableModifyInTransactionException ex) {
             log.info("Exception for expected in Proxy: {}", ex.getMessage());
-        } catch (SQLException ex) {
+        } catch (final SQLException ex) {
             log.info("Exception for expected in JDBC: {}", ex.getMessage());
         } finally {
             connection.rollback();
diff --git a/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/execute/ExecuteEngineTest.java b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/execute/ExecuteEngineTest.java
index 78a645372e1..226a330d68f 100644
--- a/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/execute/ExecuteEngineTest.java
+++ b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/execute/ExecuteEngineTest.java
@@ -61,10 +61,10 @@ public final class ExecuteEngineTest {
         Throwable actualCause = null;
         try {
             future.get();
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException ex) {
             fail();
-        } catch (ExecutionException e) {
-            actualCause = e.getCause();
+        } catch (final ExecutionException ex) {
+            actualCause = ex.getCause();
         }
         assertThat(actualCause, is(expectedException));
         shutdownAndAwaitTerminal(executeEngine);