You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by me...@apache.org on 2020/08/08 15:29:10 UTC
[shardingsphere] branch master updated: Add final if class is not
design for extension
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 031961e Add final if class is not design for extension
new 21b0416 Merge pull request #6720 from terrymanu/dev
031961e is described below
commit 031961ee8e539918c9baf7e4aab58d5390dad56f
Author: terrymanu <te...@163.com>
AuthorDate: Sat Aug 8 23:25:35 2020 +0800
Add final if class is not design for extension
---
.../base/seata/raw/jdbc/SeataATOrderServiceTest.java | 2 +-
.../base/seata/spring/boot/SeataATOrderService.java | 1 -
.../control/panel/spi/fixture/FirstMetricsTrackerFacade.java | 5 +++--
.../impl/counter/ShadowHitTotalCounterMetricsTrackerTest.java | 5 ++---
.../core/common/event/EncryptRuleChangedEvent.java | 2 +-
.../core/common/event/ShadowRuleChangedEvent.java | 2 +-
.../protocol/mysql/constant/MySQLAuthenticationMethodTest.java | 2 +-
.../binlog/row/column/value/time/MySQLTimeValueUtilTest.java | 2 +-
.../spring/boot/EncryptAlgorithmProvidedBeanRegistry.java | 2 +-
.../encrypt/spring/boot/EncryptSpringBootConditionTest.java | 3 ++-
.../spring/boot/MasterSlaveAlgorithmProvidedBeanRegistry.java | 2 +-
.../validator/impl/ShardingDeleteStatementValidatorTest.java | 2 +-
.../spring/boot/ShardingAlgorithmProvidedBeanRegistry.java | 2 +-
.../shardingsphere/infra/config/fixture/WithInitAlgorithm.java | 2 +-
.../infra/config/fixture/WithoutInitAlgorithm.java | 2 +-
.../shardingsphere/infra/rule/fixture/TestTableRule.java | 2 +-
.../infra/executor/sql/context/ExecutionContext.java | 2 +-
.../dbtest/cases/assertion/ddl/DDLIntegrateTestCase.java | 2 +-
.../cases/assertion/ddl/DDLIntegrateTestCaseAssertion.java | 2 +-
.../dbtest/cases/assertion/ddl/DDLIntegrateTestCases.java | 2 +-
.../YamlOrchestrationShardingSphereDataSourceFactoryTest.java | 2 +-
.../jdbc/execute/engine/RegistryCenterExecuteEngine.java | 10 +++++-----
.../sctl/hint/internal/command/HintErrorParameterCommand.java | 2 +-
.../jdbc/recognizer/impl/P6SpyDriverRecognizerTest.java | 2 +-
.../sctl/explain/ShardingCTLExplainBackendHandlerTest.java | 2 +-
.../convert/CreateDataSourcesStatementContextConverter.java | 4 ++--
.../query/binary/execute/MySQLComStmtExecuteExecutorTest.java | 2 +-
.../query/text/query/MySQLComQueryPacketExecutorTest.java | 2 +-
.../postgresql/command/PostgreSQLCommandExecuteEngineTest.java | 2 +-
.../shardingsphere/scaling/web/HttpServerHandlerTest.java | 2 +-
.../scaling/core/exception/PrepareFailedException.java | 2 +-
.../core/execute/engine/ShardingScalingExecuteEngine.java | 2 +-
.../scaling/core/job/position/PrimaryKeyPosition.java | 2 +-
.../job/preparer/splitter/InventoryDataTaskSplitterTest.java | 2 +-
.../shardingsphere/scaling/mysql/binlog/BinlogPosition.java | 4 ++--
.../scaling/postgresql/PostgreSQLDataSourceCheckerTest.java | 2 +-
.../binder/segment/insert/values/InsertSelectContext.java | 2 +-
.../binder/segment/insert/values/OnDuplicateUpdateContext.java | 2 +-
.../sql/parser/binder/metadata/MetaDataConnectionTest.java | 7 ++++---
.../binder/metadata/column/ColumnMetaDataLoaderTest.java | 2 +-
.../sql/parser/binder/metadata/table/TableMetaDataTest.java | 2 +-
.../sql/parser/sql/segment/dal/VariableAssignSegment.java | 2 +-
.../cases/domain/segment/impl/assignment/ExpectedVariable.java | 2 +-
43 files changed, 55 insertions(+), 54 deletions(-)
diff --git a/examples/shardingsphere-jdbc-example/transaction-example/transaction-base-seata-raw-jdbc-example/src/test/java/org/apache/shardingsphere/example/transaction/base/seata/raw/jdbc/SeataATOrderServiceTest.java b/examples/shardingsphere-jdbc-example/transaction-example/transaction-base-seata-raw-jdbc-example/src/test/java/org/apache/shardingsphere/example/transaction/base/seata/raw/jdbc/SeataATOrderServiceTest.java
index d961e00..cbfbada 100644
--- a/examples/shardingsphere-jdbc-example/transaction-example/transaction-base-seata-raw-jdbc-example/src/test/java/org/apache/shardingsphere/example/transaction/base/seata/raw/jdbc/SeataATOrderServiceTest.java
+++ b/examples/shardingsphere-jdbc-example/transaction-example/transaction-base-seata-raw-jdbc-example/src/test/java/org/apache/shardingsphere/example/transaction/base/seata/raw/jdbc/SeataATOrderServiceTest.java
@@ -36,7 +36,7 @@ import static org.junit.Assert.assertThat;
- config.ype = "file"
- service.vgroup_mapping.my_test_tx_group = "default"
*/
-public class SeataATOrderServiceTest {
+public final class SeataATOrderServiceTest {
private SeataATOrderService orderService;
diff --git a/examples/shardingsphere-jdbc-example/transaction-example/transaction-base-seata-spring-boot-example/src/main/java/org/apache/shardingsphere/example/transaction/base/seata/spring/boot/SeataATOrderService.java b/examples/shardingsphere-jdbc-example/transaction-example/transaction-base-seata-spring-boot-example/src/main/java/org/apache/shardingsphere/example/transaction/base/seata/spring/boot/SeataATOrderService.java
index 2ef446c..1ca083b 100644
--- a/examples/shardingsphere-jdbc-example/transaction-example/transaction-base-seata-spring-boot-example/src/main/java/org/apache/shardingsphere/example/transaction/base/seata/spring/boot/SeataATOrderService.java
+++ b/examples/shardingsphere-jdbc-example/transaction-example/transaction-base-seata-spring-boot-example/src/main/java/org/apache/shardingsphere/example/transaction/base/seata/spring/boot/SeataATOrderService.java
@@ -31,7 +31,6 @@ import java.sql.SQLException;
/**
* Order service.
- *
*/
@Service
public class SeataATOrderService {
diff --git a/shardingsphere-control-panel/shardingsphere-control-panel-spi/src/test/java/org/apache/shardingsphere/control/panel/spi/fixture/FirstMetricsTrackerFacade.java b/shardingsphere-control-panel/shardingsphere-control-panel-spi/src/test/java/org/apache/shardingsphere/control/panel/spi/fixture/FirstMetricsTrackerFacade.java
index f675e47..3f3cfd4 100644
--- a/shardingsphere-control-panel/shardingsphere-control-panel-spi/src/test/java/org/apache/shardingsphere/control/panel/spi/fixture/FirstMetricsTrackerFacade.java
+++ b/shardingsphere-control-panel/shardingsphere-control-panel-spi/src/test/java/org/apache/shardingsphere/control/panel/spi/fixture/FirstMetricsTrackerFacade.java
@@ -17,10 +17,11 @@
package org.apache.shardingsphere.control.panel.spi.fixture;
-import java.util.function.Supplier;
import org.apache.shardingsphere.control.panel.spi.metrics.MetricsHandlerFacade;
-public class FirstMetricsTrackerFacade implements MetricsHandlerFacade {
+import java.util.function.Supplier;
+
+public final class FirstMetricsTrackerFacade implements MetricsHandlerFacade {
@Override
public void counterIncrement(final String metricsLabel, final String... labelValues) {
diff --git a/shardingsphere-control-panel/shardingsphere-metrics/shardingsphere-metrics-prometheus/src/test/java/org/apache/shardingsphere/metrics/prometheus/impl/counter/ShadowHitTotalCounterMetricsTrackerTest.java b/shardingsphere-control-panel/shardingsphere-metrics/shardingsphere-metrics-prometheus/src/test/java/org/apache/shardingsphere/metrics/prometheus/impl/counter/ShadowHitTotalCounterMetricsTrackerTest.java
index c43f62d..83516cc 100644
--- a/shardingsphere-control-panel/shardingsphere-metrics/shardingsphere-metrics-prometheus/src/test/java/org/apache/shardingsphere/metrics/prometheus/impl/counter/ShadowHitTotalCounterMetricsTrackerTest.java
+++ b/shardingsphere-control-panel/shardingsphere-metrics/shardingsphere-metrics-prometheus/src/test/java/org/apache/shardingsphere/metrics/prometheus/impl/counter/ShadowHitTotalCounterMetricsTrackerTest.java
@@ -25,7 +25,7 @@ import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-public class ShadowHitTotalCounterMetricsTrackerTest extends AbstractPrometheusCollectorRegistry {
+public final class ShadowHitTotalCounterMetricsTrackerTest extends AbstractPrometheusCollectorRegistry {
@Test
public void counterShadowHitTotal() {
@@ -33,7 +33,6 @@ public class ShadowHitTotalCounterMetricsTrackerTest extends AbstractPrometheusC
assertThat(tracker.metricsLabel(), is(MetricsLabelEnum.SHADOW_HIT_TOTAL.getName()));
assertThat(tracker.metricsType(), is(MetricsTypeEnum.COUNTER.name()));
tracker.inc(1.0);
- Double total = getCollectorRegistry().getSampleValue("shadow_hit_total");
- assertThat(total, is(1.0));
+ assertThat(getCollectorRegistry().getSampleValue("shadow_hit_total"), is(1.0));
}
}
diff --git a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/src/main/java/org/apache/shardingsphere/orchestration/core/common/event/EncryptRuleChangedEvent.java b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/src/main/java/org/apache/shardingsphere/orchestration/core/common/event/EncryptRuleChangedEvent.java
index 1c8f731..9310b38 100644
--- a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/src/main/java/org/apache/shardingsphere/orchestration/core/common/event/EncryptRuleChangedEvent.java
+++ b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/src/main/java/org/apache/shardingsphere/orchestration/core/common/event/EncryptRuleChangedEvent.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
*/
@RequiredArgsConstructor
@Getter
-public class EncryptRuleChangedEvent implements OrchestrationEvent {
+public final class EncryptRuleChangedEvent implements OrchestrationEvent {
private final String shardingSchemaName;
diff --git a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/src/main/java/org/apache/shardingsphere/orchestration/core/common/event/ShadowRuleChangedEvent.java b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/src/main/java/org/apache/shardingsphere/orchestration/core/common/event/ShadowRuleChangedEvent.java
index e9b1a04..339ed96 100644
--- a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/src/main/java/org/apache/shardingsphere/orchestration/core/common/event/ShadowRuleChangedEvent.java
+++ b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/src/main/java/org/apache/shardingsphere/orchestration/core/common/event/ShadowRuleChangedEvent.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
*/
@RequiredArgsConstructor
@Getter
-public class ShadowRuleChangedEvent implements OrchestrationEvent {
+public final class ShadowRuleChangedEvent implements OrchestrationEvent {
private final String shardingSchemaName;
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationMethodTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationMethodTest.java
index acf0b3f..0827f92 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationMethodTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/constant/MySQLAuthenticationMethodTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-public class MySQLAuthenticationMethodTest {
+public final class MySQLAuthenticationMethodTest {
@Test
public void assertGetMethodName() {
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/binlog/row/column/value/time/MySQLTimeValueUtilTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/binlog/row/column/value/time/MySQLTimeValueUtilTest.java
index 3934fd7..da0d726 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/binlog/row/column/value/time/MySQLTimeValueUtilTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/binlog/row/column/value/time/MySQLTimeValueUtilTest.java
@@ -24,7 +24,7 @@ import java.text.SimpleDateFormat;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-public class MySQLTimeValueUtilTest {
+public final class MySQLTimeValueUtilTest {
@Test
public void assertGetSimpleDateFormat() {
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/main/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptAlgorithmProvidedBeanRegistry.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/main/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptAlgorithmProvidedBeanRegistry.java
index 359f14f..2b633d3 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/main/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptAlgorithmProvidedBeanRegistry.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/main/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptAlgorithmProvidedBeanRegistry.java
@@ -26,7 +26,7 @@ import org.springframework.core.env.Environment;
/**
* Encrypt algorithm provided bean registry.
*/
-public class EncryptAlgorithmProvidedBeanRegistry extends AbstractAlgorithmProvidedBeanRegistry {
+public final class EncryptAlgorithmProvidedBeanRegistry extends AbstractAlgorithmProvidedBeanRegistry {
private static final String ENCRYPTORS_ALGORITHMS = "spring.shardingsphere.rules.encrypt.encryptors.";
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptSpringBootConditionTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptSpringBootConditionTest.java
index e53eb11..24bb767 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptSpringBootConditionTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptSpringBootConditionTest.java
@@ -27,6 +27,7 @@ import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.mock.env.MockEnvironment;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;
@@ -54,7 +55,7 @@ public final class EncryptSpringBootConditionTest {
when(context.getEnvironment()).thenReturn(mockEnvironment);
EncryptSpringBootCondition condition = new EncryptSpringBootCondition();
ConditionOutcome matchOutcome = condition.getMatchOutcome(context, metadata);
- assertTrue(matchOutcome.isMatch());
+ assertFalse(matchOutcome.isMatch());
}
}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/MasterSlaveAlgorithmProvidedBeanRegistry.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/MasterSlaveAlgorithmProvidedBeanRe [...]
index 888eb96..4ca9c9e 100644
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/MasterSlaveAlgorithmProvidedBeanRegistry.java
+++ b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/MasterSlaveAlgorithmProvidedBeanRegistry.java
@@ -26,7 +26,7 @@ import org.springframework.core.env.Environment;
/**
* Master slave algorithm provided bean registry.
*/
-public class MasterSlaveAlgorithmProvidedBeanRegistry extends AbstractAlgorithmProvidedBeanRegistry {
+public final class MasterSlaveAlgorithmProvidedBeanRegistry extends AbstractAlgorithmProvidedBeanRegistry {
private static final String MASTER_SLAVE_ALGORITHMS = "spring.shardingsphere.rules.master-slave.load-balancers.";
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/impl/ShardingDeleteStatementValidatorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/impl/ShardingDeleteStatementValidatorTest.java
index 3ade40f..7ed6607 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/impl/ShardingDeleteStatementValidatorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/impl/ShardingDeleteStatementValidatorTest.java
@@ -32,7 +32,7 @@ import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
-public class ShardingDeleteStatementValidatorTest {
+public final class ShardingDeleteStatementValidatorTest {
@Mock
private ShardingRule shardingRule;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-boot-starter/src/main/java/org/apache/shardingsphere/sharding/spring/boot/ShardingAlgorithmProvidedBeanRegistry.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-boot-starter/src/main/java/org/apache/shardingsphere/sharding/spring/boot/ShardingAlgorithmProvidedBeanRegistry.java
index 36a62e9..d2ff180 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-boot-starter/src/main/java/org/apache/shardingsphere/sharding/spring/boot/ShardingAlgorithmProvidedBeanRegistry.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-boot-starter/src/main/java/org/apache/shardingsphere/sharding/spring/boot/ShardingAlgorithmProvidedBeanRegistry.java
@@ -27,7 +27,7 @@ import org.springframework.core.env.Environment;
/**
* Sharding algorithm provided bean registry.
*/
-public class ShardingAlgorithmProvidedBeanRegistry extends AbstractAlgorithmProvidedBeanRegistry {
+public final class ShardingAlgorithmProvidedBeanRegistry extends AbstractAlgorithmProvidedBeanRegistry {
private static final String SHARDING_ALGORITHMS = "spring.shardingsphere.rules.sharding.sharding-algorithms.";
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/fixture/WithInitAlgorithm.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/fixture/WithInitAlgorithm.java
index 46711ea..b462aa0 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/fixture/WithInitAlgorithm.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/fixture/WithInitAlgorithm.java
@@ -26,7 +26,7 @@ import java.util.Properties;
@Getter
@Setter
-public class WithInitAlgorithm implements ShardingSphereAlgorithm, ShardingSphereAlgorithmPostProcessor {
+public final class WithInitAlgorithm implements ShardingSphereAlgorithm, ShardingSphereAlgorithmPostProcessor {
private Properties props;
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/fixture/WithoutInitAlgorithm.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/fixture/WithoutInitAlgorithm.java
index e90d8c5..536c2d1 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/fixture/WithoutInitAlgorithm.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/fixture/WithoutInitAlgorithm.java
@@ -25,7 +25,7 @@ import java.util.Properties;
@Getter
@Setter
-public class WithoutInitAlgorithm implements ShardingSphereAlgorithm {
+public final class WithoutInitAlgorithm implements ShardingSphereAlgorithm {
private Properties props;
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/fixture/TestTableRule.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/fixture/TestTableRule.java
index 00950e7..7c2caa1 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/fixture/TestTableRule.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/fixture/TestTableRule.java
@@ -31,7 +31,7 @@ import java.util.Set;
import java.util.stream.Collectors;
@Getter
-public class TestTableRule {
+public final class TestTableRule {
private final String logicTable;
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/context/ExecutionContext.java b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/context/ExecutionContext.java
index b8c6223..68442f4 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/context/ExecutionContext.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/context/ExecutionContext.java
@@ -29,7 +29,7 @@ import java.util.Collections;
*/
@RequiredArgsConstructor
@Getter
-public class ExecutionContext {
+public final class ExecutionContext {
private final SQLStatementContext sqlStatementContext;
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCase.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCase.java
index 91dfcbf..9e994eb 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCase.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCase.java
@@ -28,7 +28,7 @@ import java.util.List;
* JAXB definition of DDL integrate test case.
*/
@Getter
-public class DDLIntegrateTestCase extends IntegrateTestCase {
+public final class DDLIntegrateTestCase extends IntegrateTestCase {
@XmlElement(name = "assertion")
private List<DDLIntegrateTestCaseAssertion> integrateTestCaseAssertions = new LinkedList<>();
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCaseAssertion.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCaseAssertion.java
index 62dd9dc..fbdc9f2 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCaseAssertion.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCaseAssertion.java
@@ -26,7 +26,7 @@ import javax.xml.bind.annotation.XmlAttribute;
* JAXB definition of DDL integrate test case assertion.
*/
@Getter
-public class DDLIntegrateTestCaseAssertion extends IntegrateTestCaseAssertion {
+public final class DDLIntegrateTestCaseAssertion extends IntegrateTestCaseAssertion {
@XmlAttribute(name = "init-sql")
private String initSql;
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCases.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCases.java
index fc87429..fe063f2 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCases.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/ddl/DDLIntegrateTestCases.java
@@ -30,7 +30,7 @@ import java.util.List;
*/
@Getter
@XmlRootElement(name = "integrate-test-cases")
-public class DDLIntegrateTestCases implements IntegrateTestCases {
+public final class DDLIntegrateTestCases implements IntegrateTestCases {
@XmlElement(name = "ddl-test-case")
private List<DDLIntegrateTestCase> integrateTestCases = new LinkedList<>();
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/test/java/org/apache/shardingsphere/driver/orchestration/api/yaml/YamlOrchestrationShardingSphereDataSourceFactoryTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/test/java/org/apache/shardingsphere/driver/orchestration/api/yaml/YamlOrchestrationShardingSphereDataSourceFactoryTest.java
index 506bbd2..9705b0d 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/test/java/org/apache/shardingsphere/driver/orchestration/api/yaml/YamlOrchestrationShardingSphereDataSourceFactoryTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/test/java/org/apache/shardingsphere/driver/orchestration/api/yaml/YamlOrchestrationShardingSphereDataSourceFactoryTest.java
@@ -32,7 +32,7 @@ import java.sql.Statement;
import java.util.Arrays;
import java.util.List;
-public class YamlOrchestrationShardingSphereDataSourceFactoryTest extends AbstractYamlDataSourceTest {
+public final class YamlOrchestrationShardingSphereDataSourceFactoryTest extends AbstractYamlDataSourceTest {
private static final List<String> CONFIG_FILES = Arrays.asList("/yaml/integrate/sharding_ms/configWithDataSourceWithProps.yaml",
"/yaml/integrate/sharding_ms/configWithoutDataSourceWithProps.yaml", "/yaml/integrate/sharding_ms/configWithDataSourceWithoutRules.yaml");
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/RegistryCenterExecuteEngine.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/RegistryCenterExecuteEngine.java
index fafe296..6dcfa5b 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/RegistryCenterExecuteEngine.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/RegistryCenterExecuteEngine.java
@@ -53,23 +53,23 @@ import java.util.Map;
* Registry center execute engine.
*/
@RequiredArgsConstructor
-public class RegistryCenterExecuteEngine implements SQLExecuteEngine {
+public final class RegistryCenterExecuteEngine implements SQLExecuteEngine {
private final String schemaName;
private final SQLStatement sqlStatement;
@Override
- public final ExecutionContext execute(final String sql) {
+ public ExecutionContext execute(final String sql) {
DatabaseType databaseType = ProxySchemaContexts.getInstance().getSchemaContexts().getSchemaContexts().get(schemaName).getSchema().getDatabaseType();
- SQLStatementContext context = sqlStatement instanceof CreateDataSourcesStatement
+ SQLStatementContext<?> sqlStatementContext = sqlStatement instanceof CreateDataSourcesStatement
? new CreateDataSourcesStatementContext((CreateDataSourcesStatement) sqlStatement, databaseType)
: new CreateShardingRuleStatementContext((CreateShardingRuleStatement) sqlStatement);
- return new ExecutionContext(context, new LinkedList<>());
+ return new ExecutionContext(sqlStatementContext, new LinkedList<>());
}
@Override
- public final BackendResponse execute(final ExecutionContext executionContext) {
+ public BackendResponse execute(final ExecutionContext executionContext) {
if (!isRegistryCenterExisted()) {
return new ErrorResponse(new SQLException("No Registry center to execute `%s` SQL", executionContext.getSqlStatementContext().getClass().getSimpleName()));
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/sctl/hint/internal/command/HintErrorParameterCommand.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/sctl/hint/internal/command/HintErrorParameterCommand.java
index 716a776..69487b7 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/sctl/hint/internal/command/HintErrorParameterCommand.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/sctl/hint/internal/command/HintErrorParameterCommand.java
@@ -22,5 +22,5 @@ import org.apache.shardingsphere.proxy.backend.text.sctl.hint.internal.HintComma
/**
* Hint error parameter command.
*/
-public class HintErrorParameterCommand implements HintCommand {
+public final class HintErrorParameterCommand implements HintCommand {
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/impl/P6SpyDriverRecognizerTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/impl/P6SpyDriverRecognizerTest.java
index 5815b77..bcee781 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/impl/P6SpyDriverRecognizerTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/recognizer/impl/P6SpyDriverRecognizerTest.java
@@ -24,7 +24,7 @@ import java.util.Collections;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-public class P6SpyDriverRecognizerTest {
+public final class P6SpyDriverRecognizerTest {
private final P6SpyDriverRecognizer recognizer = new P6SpyDriverRecognizer();
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/sctl/explain/ShardingCTLExplainBackendHandlerTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/sctl/explain/ShardingCTLExplainBackendHandlerTest.java
index 1757a36..9b9f38d 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/sctl/explain/ShardingCTLExplainBackendHandlerTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/sctl/explain/ShardingCTLExplainBackendHandlerTest.java
@@ -36,7 +36,7 @@ import static org.mockito.Mockito.when;
* limitations under the License.
*/
-public class ShardingCTLExplainBackendHandlerTest {
+public final class ShardingCTLExplainBackendHandlerTest {
private ShardingCTLExplainBackendHandler handler;
diff --git a/shardingsphere-proxy/shardingsphere-proxy-common/src/main/java/org/apache/shardingsphere/proxy/convert/CreateDataSourcesStatementContextConverter.java b/shardingsphere-proxy/shardingsphere-proxy-common/src/main/java/org/apache/shardingsphere/proxy/convert/CreateDataSourcesStatementContextConverter.java
index 95e2741..db7540e 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-common/src/main/java/org/apache/shardingsphere/proxy/convert/CreateDataSourcesStatementContextConverter.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-common/src/main/java/org/apache/shardingsphere/proxy/convert/CreateDataSourcesStatementContextConverter.java
@@ -28,11 +28,11 @@ import java.util.Map;
/**
* Create dataSource statement context converter.
*/
-public class CreateDataSourcesStatementContextConverter implements SQLStatementContextConverter<CreateDataSourcesStatementContext, Map<String, YamlDataSourceParameter>> {
+public final class CreateDataSourcesStatementContextConverter implements SQLStatementContextConverter<CreateDataSourcesStatementContext, Map<String, YamlDataSourceParameter>> {
@Override
public Map<String, YamlDataSourceParameter> convert(final CreateDataSourcesStatementContext sqlStatement) {
- Map<String, YamlDataSourceParameter> result = new LinkedHashMap<>();
+ Map<String, YamlDataSourceParameter> result = new LinkedHashMap<>(sqlStatement.getUrls().size(), 1);
for (DataSourceConnectionUrl each : sqlStatement.getUrls()) {
YamlDataSourceParameter dataSource = new YamlDataSourceParameter();
dataSource.setUrl(each.getUrl());
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutorTest.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutorTest.java
index e9abe29..620bfa5 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutorTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutorTest.java
@@ -43,7 +43,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
-public class MySQLComStmtExecuteExecutorTest {
+public final class MySQLComStmtExecuteExecutorTest {
@Mock
private SQLException sqlException;
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java
index dfc900d..d18c91c 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutorTest.java
@@ -39,7 +39,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
-public class MySQLComQueryPacketExecutorTest {
+public final class MySQLComQueryPacketExecutorTest {
@Mock
private SQLException sqlException;
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecuteEngineTest.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecuteEngineTest.java
index bc3f590..54bc2fb 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecuteEngineTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecuteEngineTest.java
@@ -32,7 +32,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
-public class PostgreSQLCommandExecuteEngineTest {
+public final class PostgreSQLCommandExecuteEngineTest {
@Mock
private ChannelHandlerContext channelHandlerContext;
diff --git a/shardingsphere-scaling/shardingsphere-scaling-bootstrap/src/test/java/org/apache/shardingsphere/scaling/web/HttpServerHandlerTest.java b/shardingsphere-scaling/shardingsphere-scaling-bootstrap/src/test/java/org/apache/shardingsphere/scaling/web/HttpServerHandlerTest.java
index 38818fe..d4e4915 100644
--- a/shardingsphere-scaling/shardingsphere-scaling-bootstrap/src/test/java/org/apache/shardingsphere/scaling/web/HttpServerHandlerTest.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-bootstrap/src/test/java/org/apache/shardingsphere/scaling/web/HttpServerHandlerTest.java
@@ -48,7 +48,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@RunWith(MockitoJUnitRunner.class)
-public class HttpServerHandlerTest {
+public final class HttpServerHandlerTest {
private static final Gson GSON = new Gson();
diff --git a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/exception/PrepareFailedException.java b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/exception/PrepareFailedException.java
index 1a05e70..7db2cf4 100644
--- a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/exception/PrepareFailedException.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/exception/PrepareFailedException.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.scaling.core.exception;
/**
* Prepare failed exception.
*/
-public class PrepareFailedException extends RuntimeException {
+public final class PrepareFailedException extends RuntimeException {
private static final long serialVersionUID = 1409505606319197767L;
diff --git a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/execute/engine/ShardingScalingExecuteEngine.java b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/execute/engine/ShardingScalingExecuteEngine.java
index 83fef03..39a1e05 100644
--- a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/execute/engine/ShardingScalingExecuteEngine.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/execute/engine/ShardingScalingExecuteEngine.java
@@ -34,7 +34,7 @@ import java.util.concurrent.Future;
/**
* Sharding scaling executor engine.
*/
-public class ShardingScalingExecuteEngine {
+public final class ShardingScalingExecuteEngine {
private final ListeningExecutorService executorService;
diff --git a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/job/position/PrimaryKeyPosition.java b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/job/position/PrimaryKeyPosition.java
index d3eee8e..1682959 100644
--- a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/job/position/PrimaryKeyPosition.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/job/position/PrimaryKeyPosition.java
@@ -31,7 +31,7 @@ import lombok.Setter;
@AllArgsConstructor
@Getter
@Setter
-public class PrimaryKeyPosition implements InventoryPosition {
+public final class PrimaryKeyPosition implements InventoryPosition {
private static final Gson GSON = new Gson();
diff --git a/shardingsphere-scaling/shardingsphere-scaling-core/src/test/java/org/apache/shardingsphere/scaling/core/job/preparer/splitter/InventoryDataTaskSplitterTest.java b/shardingsphere-scaling/shardingsphere-scaling-core/src/test/java/org/apache/shardingsphere/scaling/core/job/preparer/splitter/InventoryDataTaskSplitterTest.java
index d46326a..e30324f 100644
--- a/shardingsphere-scaling/shardingsphere-scaling-core/src/test/java/org/apache/shardingsphere/scaling/core/job/preparer/splitter/InventoryDataTaskSplitterTest.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-core/src/test/java/org/apache/shardingsphere/scaling/core/job/preparer/splitter/InventoryDataTaskSplitterTest.java
@@ -40,7 +40,7 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
-public class InventoryDataTaskSplitterTest {
+public final class InventoryDataTaskSplitterTest {
private static final String DATA_SOURCE_URL = "jdbc:h2:mem:test_db;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL";
diff --git a/shardingsphere-scaling/shardingsphere-scaling-mysql/src/main/java/org/apache/shardingsphere/scaling/mysql/binlog/BinlogPosition.java b/shardingsphere-scaling/shardingsphere-scaling-mysql/src/main/java/org/apache/shardingsphere/scaling/mysql/binlog/BinlogPosition.java
index ed3ba2a..950600d 100644
--- a/shardingsphere-scaling/shardingsphere-scaling-mysql/src/main/java/org/apache/shardingsphere/scaling/mysql/binlog/BinlogPosition.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-mysql/src/main/java/org/apache/shardingsphere/scaling/mysql/binlog/BinlogPosition.java
@@ -35,7 +35,7 @@ import org.apache.shardingsphere.scaling.core.job.position.Position;
@RequiredArgsConstructor
@Setter
@Getter
-public class BinlogPosition implements IncrementalPosition {
+public final class BinlogPosition implements IncrementalPosition {
private static final Gson GSON = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
@@ -48,7 +48,7 @@ public class BinlogPosition implements IncrementalPosition {
private long serverId;
@Override
- public final int compareTo(final Position position) {
+ public int compareTo(final Position position) {
if (null == position) {
return 1;
}
diff --git a/shardingsphere-scaling/shardingsphere-scaling-postgresql/src/test/java/org/apache/shardingsphere/scaling/postgresql/PostgreSQLDataSourceCheckerTest.java b/shardingsphere-scaling/shardingsphere-scaling-postgresql/src/test/java/org/apache/shardingsphere/scaling/postgresql/PostgreSQLDataSourceCheckerTest.java
index 592c907..04bc399 100644
--- a/shardingsphere-scaling/shardingsphere-scaling-postgresql/src/test/java/org/apache/shardingsphere/scaling/postgresql/PostgreSQLDataSourceCheckerTest.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-postgresql/src/test/java/org/apache/shardingsphere/scaling/postgresql/PostgreSQLDataSourceCheckerTest.java
@@ -39,7 +39,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
-public class PostgreSQLDataSourceCheckerTest {
+public final class PostgreSQLDataSourceCheckerTest {
private static final String CATALOG = "test";
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/insert/values/InsertSelectContext.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/insert/values/InsertSelectContext.java
index 79b74f4..6ccd0f8 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/insert/values/InsertSelectContext.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/insert/values/InsertSelectContext.java
@@ -30,7 +30,7 @@ import java.util.List;
*/
@Getter
@ToString
-public class InsertSelectContext {
+public final class InsertSelectContext {
private final int parametersCount;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/insert/values/OnDuplicateUpdateContext.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/insert/values/OnDuplicateUpdateContext.java
index 5da791b..a959424 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/insert/values/OnDuplicateUpdateContext.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/insert/values/OnDuplicateUpdateContext.java
@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
@Getter
@ToString
-public class OnDuplicateUpdateContext {
+public final class OnDuplicateUpdateContext {
private final int parametersCount;
private final List<ExpressionSegment> valueExpressions;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/MetaDataConnectionTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/MetaDataConnectionTest.java
index 83d699e..a45660e 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/MetaDataConnectionTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/MetaDataConnectionTest.java
@@ -17,20 +17,21 @@
package org.apache.shardingsphere.sql.parser.binder.metadata;
-import java.sql.Connection;
-import java.sql.SQLException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
+import java.sql.Connection;
+import java.sql.SQLException;
+
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
-public class MetaDataConnectionTest {
+public final class MetaDataConnectionTest {
private static final String TEST_CATALOG = "catalog";
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/column/ColumnMetaDataLoaderTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/column/ColumnMetaDataLoaderTest.java
index 2102ab2..5068a46 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/column/ColumnMetaDataLoaderTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/column/ColumnMetaDataLoaderTest.java
@@ -39,7 +39,7 @@ import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
-public class ColumnMetaDataLoaderTest {
+public final class ColumnMetaDataLoaderTest {
private static final String TEST_CATALOG = "catalog";
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/table/TableMetaDataTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/table/TableMetaDataTest.java
index f4abbfe..6e2e921 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/table/TableMetaDataTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/table/TableMetaDataTest.java
@@ -29,7 +29,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-public class TableMetaDataTest {
+public final class TableMetaDataTest {
private TableMetaData tableMetaData;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/dal/VariableAssignSegment.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/dal/VariableAssignSegment.java
index 69f4910..0ed8bea 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/dal/VariableAssignSegment.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/dal/VariableAssignSegment.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.sql.parser.sql.segment.SQLSegment;
@Getter
@Setter
-public class VariableAssignSegment implements SQLSegment {
+public final class VariableAssignSegment implements SQLSegment {
private int startIndex;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/segment/impl/assignment/ExpectedVariable.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/segment/impl/assignment/ExpectedVariable.java
index 66c95a1..8389d9b 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/segment/impl/assignment/ExpectedVariable.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/segment/impl/assignment/ExpectedVariable.java
@@ -25,7 +25,7 @@ import javax.xml.bind.annotation.XmlAttribute;
@Setter
@Getter
-public class ExpectedVariable extends AbstractExpectedSQLSegment {
+public final class ExpectedVariable extends AbstractExpectedSQLSegment {
@XmlAttribute
private String scope;