This is an automated email from the ASF dual-hosted git repository.
wuweijie 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 961d2c1 For checkstyle (#11182)
961d2c1 is described below
commit 961d2c1ed89b3a45a2ceb65768d0ba11c9ba4ae6
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Jul 7 00:03:35 2021 +0800
For checkstyle (#11182)
---
.../src/main/resources/application.properties | 2 +-
.../shardingsphere-sharding/shardingsphere-sharding-api/pom.xml | 2 +-
.../shardingsphere/infra/config/DataSourceConfigurationTest.java | 2 +-
.../refresher/type/CreateTableStatementSchemaRefresherTest.java | 7 +++----
.../core/convert/converter/impl/OffsetSqlNodeConverter.java | 4 +++-
.../core/convert/converter/impl/RowCountSqlNodeConverter.java | 4 +++-
.../text/admin/mysql/executor/ShowDatabasesExecutorTest.java | 2 +-
.../mysql/visitor/statement/impl/MySQLDCLStatementSQLVisitor.java | 3 ---
.../sql/parser/sql/dialect/handler/dml/SelectStatementHandler.java | 2 +-
.../shardingsphere-integration-agent-test-jaeger/pom.xml | 2 +-
.../shardingsphere-integration-agent-test-metrics/pom.xml | 2 +-
.../shardingsphere-integration-agent-test-zipkin/pom.xml | 2 +-
.../integration/scaling/test/mysql/util/ScalingUtil.java | 3 ++-
.../src/main/resources/sql/supported/rdl/drop.xml | 2 +-
14 files changed, 20 insertions(+), 19 deletions(-)
diff --git
a/examples/shardingsphere-jdbc-example/governance-example/governance-spring-boot-example/src/main/resources/application.properties
b/examples/shardingsphere-jdbc-example/governance-example/governance-spring-boot-example/src/main/resources/application.properties
index 2f57e77..dbffe80 100644
---
a/examples/shardingsphere-jdbc-example/governance-example/governance-spring-boot-example/src/main/resources/application.properties
+++
b/examples/shardingsphere-jdbc-example/governance-example/governance-spring-boot-example/src/main/resources/application.properties
@@ -29,4 +29,4 @@
spring.profiles.active=local-zookeeper-sharding-databases-tables
#spring.profiles.active=cloud-zookeeper-encrypt
#spring.profiles.active=local-zookeeper-shadow
-#spring.profiles.active=cloud-zookeeper-shadow
\ No newline at end of file
+#spring.profiles.active=cloud-zookeeper-shadow
diff --git
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/pom.xml
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/pom.xml
index be2ed77..835edc2 100644
---
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/pom.xml
+++
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/pom.xml
@@ -35,4 +35,4 @@
<version>${project.version}</version>
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/DataSourceConfigurationTest.java
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/DataSourceConfigurationTest.java
index 104f03c..93b9b7c 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/DataSourceConfigurationTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/DataSourceConfigurationTest.java
@@ -84,7 +84,7 @@ public final class DataSourceConfigurationTest {
props.put("driverClassName", "org.h2.Driver");
props.put("jdbcUrl",
"jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL");
props.put("username", "root");
- props.put("password", Integer.valueOf(123));
+ props.put("password", 123);
props.put("loginTimeout", "5000");
DataSourceConfiguration dataSourceConfig = new
DataSourceConfiguration(HikariDataSource.class.getName());
dataSourceConfig.getProps().putAll(props);
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/refresher/type/CreateTableStatementSchemaRefresherTest.java
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/refresher/type/CreateTableStatementSchemaRefresherTest.java
index 15f8378..87c9f6b 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/refresher/type/CreateTableStatementSchemaRefresherTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/refresher/type/CreateTableStatementSchemaRefresherTest.java
@@ -43,7 +43,6 @@ import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -155,10 +154,10 @@ public final class
CreateTableStatementSchemaRefresherTest {
private void refreshWithTableRule(final CreateTableStatement
createTableStatement) throws SQLException {
createTableStatement.setTable(new SimpleTableSegment(new
TableNameSegment(1, 3, new IdentifierValue("t_order_0"))));
- ShardingSphereRule rule = mock(TableContainedRule.class);
- Collection<ShardingSphereRule> rules = Arrays.asList(rule);
+ TableContainedRule rule = mock(TableContainedRule.class);
+ Collection<ShardingSphereRule> rules = Collections.singletonList(rule);
when(materials.getRules()).thenReturn(rules);
- when(((TableContainedRule)
rule).getTables()).thenReturn(Arrays.asList("t_order_0"));
+
when(rule.getTables()).thenReturn(Collections.singletonList("t_order_0"));
Map<String, DataSource> dataSourceMap = mock(HashMap.class);
when(materials.getDataSourceMap()).thenReturn(dataSourceMap);
DataSource dataSource = mock(DataSource.class);
diff --git
a/shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/core/convert/converter/impl/OffsetSqlNodeConverter.java
b/shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/core/convert/converter/impl/OffsetSqlNodeConverter.java
index d4e5d5a..0a3df3e 100644
---
a/shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/core/convert/converter/impl/OffsetSqlNodeConverter.java
+++
b/shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/core/convert/converter/impl/OffsetSqlNodeConverter.java
@@ -17,12 +17,14 @@
package org.apache.shardingsphere.infra.optimize.core.convert.converter.impl;
+import
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.LimitSegment;
+
/**
* Offset sql node converter.
*/
public final class OffsetSqlNodeConverter extends
AbstractLimitSqlNodeConverter {
public OffsetSqlNodeConverter() {
- super(limitSegment -> limitSegment.getOffset());
+ super(LimitSegment::getOffset);
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/core/convert/converter/impl/RowCountSqlNodeConverter.java
b/shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/core/convert/converter/impl/RowCountSqlNodeConverter.java
index 10a77ba..df51290 100644
---
a/shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/core/convert/converter/impl/RowCountSqlNodeConverter.java
+++
b/shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/core/convert/converter/impl/RowCountSqlNodeConverter.java
@@ -17,12 +17,14 @@
package org.apache.shardingsphere.infra.optimize.core.convert.converter.impl;
+import
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.LimitSegment;
+
/**
* Row count sql node converter.
*/
public final class RowCountSqlNodeConverter extends
AbstractLimitSqlNodeConverter {
public RowCountSqlNodeConverter() {
- super(limitSegment -> limitSegment.getRowCount());
+ super(LimitSegment::getRowCount);
}
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/ShowDatabasesExecutorTest.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/ShowDatabasesExecutorTest.java
index 7dbfbfa..500aa82 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/ShowDatabasesExecutorTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/ShowDatabasesExecutorTest.java
@@ -67,7 +67,7 @@ public final class ShowDatabasesExecutorTest {
ShardingSphereMetaData metaData =
mock(ShardingSphereMetaData.class, RETURNS_DEEP_STUBS);
when(metaData.getResource().getDatabaseType()).thenReturn(new
MySQLDatabaseType());
when(metaData.getRuleMetaData().getRules()).thenReturn(Collections.emptyList());
- result.put(String.format(SCHEMA_PATTERN, String.valueOf(i)),
metaData);
+ result.put(String.format(SCHEMA_PATTERN, i), metaData);
}
return result;
}
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLDCLStatementSQLVisitor.java
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLDCLStatementSQLVisitor.java
index 637bbaa..28b5d93 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLDCLStatementSQLVisitor.java
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLDCLStatementSQLVisitor.java
@@ -152,9 +152,6 @@ public final class MySQLDCLStatementSQLVisitor extends
MySQLStatementSQLVisitor
}
if (null != ctx.aclType()) {
switch (ctx.aclType().getText().toLowerCase()) {
- case "table":
- result.setAclType(ACLTypeEnum.TABLE);
- break;
case "function":
result.setAclType(ACLTypeEnum.FUNCTION);
break;
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/SelectStatementHandler.java
b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/SelectStatementHandler.java
index d49aecb..7b3e9a4 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/SelectStatementHandler.java
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/SelectStatementHandler.java
@@ -109,7 +109,7 @@ public final class SelectStatementHandler implements
SQLStatementHandler {
*/
public static Optional<WithSegment> getWithSegment(final SelectStatement
selectStatement) {
if (selectStatement instanceof OracleStatement) {
- return ((OracleSelectStatement) selectStatement).getWithSegment();
+ return selectStatement.getWithSegment();
}
return Optional.empty();
}
diff --git
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-jaeger/pom.xml
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-jaeger/pom.xml
index c325b36..07b086c 100644
---
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-jaeger/pom.xml
+++
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-jaeger/pom.xml
@@ -155,4 +155,4 @@
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
diff --git
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/pom.xml
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/pom.xml
index 48face0..54502ec 100644
---
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/pom.xml
+++
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/pom.xml
@@ -183,4 +183,4 @@
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
diff --git
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-zipkin/pom.xml
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-zipkin/pom.xml
index 981be3b..7514620 100644
---
a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-zipkin/pom.xml
+++
b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-zipkin/pom.xml
@@ -155,4 +155,4 @@
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
diff --git
a/shardingsphere-test/shardingsphere-integration-scaling-test/shardingsphere-integration-scaling-test-mysql/src/test/java/org/apache/shardingsphere/integration/scaling/test/mysql/util/ScalingUtil.java
b/shardingsphere-test/shardingsphere-integration-scaling-test/shardingsphere-integration-scaling-test-mysql/src/test/java/org/apache/shardingsphere/integration/scaling/test/mysql/util/ScalingUtil.java
index d70661b..4378b74 100644
---
a/shardingsphere-test/shardingsphere-integration-scaling-test/shardingsphere-integration-scaling-test-mysql/src/test/java/org/apache/shardingsphere/integration/scaling/test/mysql/util/ScalingUtil.java
+++
b/shardingsphere-test/shardingsphere-integration-scaling-test/shardingsphere-integration-scaling-test-mysql/src/test/java/org/apache/shardingsphere/integration/scaling/test/mysql/util/ScalingUtil.java
@@ -30,6 +30,7 @@ import
org.apache.shardingsphere.integration.scaling.test.mysql.env.IntegrationT
import java.io.IOException;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -122,7 +123,7 @@ public final class ScalingUtil {
public Map<String, Tuple2<Boolean, Boolean>> getJobCheckResult(final
String jobId) throws IOException {
JsonElement response = getInstance().get(scalingUrl +
"/scaling/job/check/" + jobId);
return
response.getAsJsonObject().getAsJsonObject("model").getAsJsonObject().entrySet().stream().collect(
- Collectors.toMap(entry -> entry.getKey(), entry ->
createTaskResult(entry)));
+ Collectors.toMap(Entry::getKey, this::createTaskResult));
}
private Tuple2<Boolean, Boolean> createTaskResult(final Map.Entry<String,
JsonElement> entry) {
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/rdl/drop.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/rdl/drop.xml
index bdd5d3a..252f349 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/rdl/drop.xml
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/rdl/drop.xml
@@ -24,4 +24,4 @@
<sql-case id="drop-readwrite-splitting-rule" value="DROP
READWRITE_SPLITTING RULE ms_group_0,ms_group_1" db-types="DistSQL" />
<sql-case id="drop-database-discovery-rule" value="DROP DB_DISCOVERY RULE
ha_group_0,ha_group_1" db-types="DistSQL" />
<sql-case id="drop-encrypt-rule" value="DROP ENCRYPT RULE
t_encrypt,t_encrypt_order" db-types="DistSQL" />
-</sql-cases>
\ No newline at end of file
+</sql-cases>