You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2021/03/25 13:03:10 UTC
[shardingsphere] branch master updated: Remove useless @slf4j
(#9823)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 5c896a4 Remove useless @slf4j (#9823)
5c896a4 is described below
commit 5c896a4328716e919fa581ad16b8a0d9fe0ac937
Author: Liang Zhang <te...@163.com>
AuthorDate: Thu Mar 25 21:02:37 2021 +0800
Remove useless @slf4j (#9823)
* Remove @NonNull
* Remove useless @Slf4j
---
.../transformer/ShardingSphereTransformer.java | 9 +++---
.../ComposeClassStaticMethodAroundAdvice.java | 11 +++----
.../advice/ComposeConstructorAdvice.java | 5 ++-
.../advice/ComposeInstanceMethodAroundAdvice.java | 11 +++----
.../ComposeClassStaticMethodAroundInterceptor.java | 9 ++----
.../compose/ComposeConstructorInterceptor.java | 3 --
.../ComposeInstanceMethodAroundInterceptor.java | 5 +--
.../register/PrometheusMetricsRegister.java | 5 ++-
.../command/query/PostgreSQLColumnDescription.java | 2 --
.../rule/DatabaseDiscoveryDataSourceRule.java | 2 --
.../db/discovery/mgr/MGRHeartbeatJob.java | 4 +--
.../raw/callback/RawSQLExecutorCallback.java | 1 -
.../AbstractDataConsistencyChecker.java | 4 +--
.../client/netty/MySQLCommandPacketDecoder.java | 8 ++---
.../agent/test/jaeger/JaegerPluginIT.java | 2 --
.../agent/test/zipkin/ZipkinPluginIT.java | 2 --
.../embedded/type/PostgreSQLEmbeddedDatabase.java | 12 +++-----
.../adapter/impl/ShardingSphereJDBCContainer.java | 5 +--
.../junit/param/ParameterizedArrayFactory.java | 4 +--
.../junit/runner/ShardingSphereCISubRunner.java | 8 ++---
.../junit/runner/ShardingSphereITSubRunner.java | 18 +++++------
.../junit/runner/ShardingSphereRunner.java | 36 ++++++++++------------
.../xa/manager/XATransactionManagerLoader.java | 14 ++++-----
23 files changed, 69 insertions(+), 111 deletions(-)
diff --git a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/ShardingSphereTransformer.java b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/ShardingSphereTransformer.java
index f1c0cb0..10d4782 100644
--- a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/ShardingSphereTransformer.java
+++ b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/ShardingSphereTransformer.java
@@ -45,6 +45,7 @@ import org.apache.shardingsphere.agent.core.plugin.interceptor.compose.ComposeCl
import org.apache.shardingsphere.agent.core.plugin.interceptor.compose.ComposeConstructorInterceptor;
import org.apache.shardingsphere.agent.core.plugin.interceptor.compose.ComposeInstanceMethodAroundInterceptor;
+import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -52,8 +53,8 @@ import java.util.stream.Collectors;
/**
* ShardingSphere transformer.
*/
-@Slf4j
@RequiredArgsConstructor
+@Slf4j
public final class ShardingSphereTransformer implements Transformer {
private static final String EXTRA_DATA = "_$EXTRA_DATA$_";
@@ -112,7 +113,7 @@ public final class ShardingSphereTransformer implements Transformer {
private Builder<?> interceptorClassStaticMethodPoint(final TypeDescription description, final List<ClassStaticMethodPoint> classStaticMethodAroundPoints, final Builder<?> builder) {
List<ShardingSphereTransformationPoint<? extends ClassStaticMethodAroundInterceptor>> classStaticMethodAdvicePoints = description.getDeclaredMethods().stream()
- .filter(md -> md.isStatic() && !(md.isAbstract() || md.isSynthetic()))
+ .filter(each -> each.isStatic() && !(each.isAbstract() || each.isSynthetic()))
.map(md -> {
List<ClassStaticMethodPoint> classStaticMethodPoints = classStaticMethodAroundPoints.stream().filter(point -> point.getMatcher().matches(md)).collect(Collectors.toList());
if (classStaticMethodPoints.isEmpty()) {
@@ -121,7 +122,7 @@ public final class ShardingSphereTransformer implements Transformer {
if (classStaticMethodPoints.size() == 1) {
return new ShardingSphereTransformationPoint<>(md, new ClassStaticMethodAroundInterceptor(pluginLoader.getOrCreateInstance(classStaticMethodPoints.get(0).getAdvice())));
} else {
- List<ClassStaticMethodAroundAdvice> classStaticMethodAroundAdvices = classStaticMethodPoints.stream()
+ Collection<ClassStaticMethodAroundAdvice> classStaticMethodAroundAdvices = classStaticMethodPoints.stream()
.map(ClassStaticMethodPoint::getAdvice)
.map(advice -> (ClassStaticMethodAroundAdvice) pluginLoader.getOrCreateInstance(advice))
.collect(Collectors.toList());
@@ -146,7 +147,7 @@ public final class ShardingSphereTransformer implements Transformer {
private Builder<?> interceptorInstanceMethodPoint(final TypeDescription description, final List<InstanceMethodPoint> instanceMethodAroundPoints, final Builder<?> builder) {
List<ShardingSphereTransformationPoint<? extends InstanceMethodAroundInterceptor>> instanceMethodAdviceComposePoints = description.getDeclaredMethods().stream()
- .filter(md -> !(md.isAbstract() || md.isSynthetic()))
+ .filter(each -> !(each.isAbstract() || each.isSynthetic()))
.map(md -> {
List<InstanceMethodPoint> instanceMethodPoints = instanceMethodAroundPoints.stream().filter(point -> point.getMatcher().matches(md)).collect(Collectors.toList());
if (instanceMethodPoints.isEmpty()) {
diff --git a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeClassStaticMethodAroundAdvice.java b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeClassStaticMethodAroundAdvice.java
index 3bc3228..6057cbb 100644
--- a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeClassStaticMethodAroundAdvice.java
+++ b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeClassStaticMethodAroundAdvice.java
@@ -17,13 +17,12 @@
package org.apache.shardingsphere.agent.core.bytebuddy.transformer.advice;
-import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.agent.api.advice.ClassStaticMethodAroundAdvice;
import org.apache.shardingsphere.agent.api.result.MethodInvocationResult;
import java.lang.reflect.Method;
-import java.util.List;
+import java.util.Collection;
/**
* Compose class static method around advice.
@@ -31,20 +30,20 @@ import java.util.List;
@RequiredArgsConstructor
public final class ComposeClassStaticMethodAroundAdvice implements ClassStaticMethodAroundAdvice {
- private final @NonNull List<ClassStaticMethodAroundAdvice> adviceList;
+ private final Collection<ClassStaticMethodAroundAdvice> advices;
@Override
public void beforeMethod(final Class<?> clazz, final Method method, final Object[] args, final MethodInvocationResult result) {
- adviceList.forEach(each -> each.beforeMethod(clazz, method, args, result));
+ advices.forEach(each -> each.beforeMethod(clazz, method, args, result));
}
@Override
public void afterMethod(final Class<?> clazz, final Method method, final Object[] args, final MethodInvocationResult result) {
- adviceList.forEach(each -> each.afterMethod(clazz, method, args, result));
+ advices.forEach(each -> each.afterMethod(clazz, method, args, result));
}
@Override
public void onThrowing(final Class<?> clazz, final Method method, final Object[] args, final Throwable throwable) {
- adviceList.forEach(each -> each.onThrowing(clazz, method, args, throwable));
+ advices.forEach(each -> each.onThrowing(clazz, method, args, throwable));
}
}
diff --git a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeConstructorAdvice.java b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeConstructorAdvice.java
index 9869cb3..0c4846a 100644
--- a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeConstructorAdvice.java
+++ b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeConstructorAdvice.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.agent.core.bytebuddy.transformer.advice;
-import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.agent.api.advice.AdviceTargetObject;
import org.apache.shardingsphere.agent.api.advice.ConstructorAdvice;
@@ -30,10 +29,10 @@ import java.util.List;
@RequiredArgsConstructor
public final class ComposeConstructorAdvice implements ConstructorAdvice {
- private final @NonNull List<ConstructorAdvice> adviceList;
+ private final List<ConstructorAdvice> advices;
@Override
public void onConstructor(final AdviceTargetObject target, final Object[] args) {
- adviceList.forEach(each -> each.onConstructor(target, args));
+ advices.forEach(each -> each.onConstructor(target, args));
}
}
diff --git a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeInstanceMethodAroundAdvice.java b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeInstanceMethodAroundAdvice.java
index 42fdb04..98bfa50 100644
--- a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeInstanceMethodAroundAdvice.java
+++ b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/bytebuddy/transformer/advice/ComposeInstanceMethodAroundAdvice.java
@@ -17,10 +17,9 @@
package org.apache.shardingsphere.agent.core.bytebuddy.transformer.advice;
-import lombok.NonNull;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.agent.api.advice.InstanceMethodAroundAdvice;
import org.apache.shardingsphere.agent.api.advice.AdviceTargetObject;
+import org.apache.shardingsphere.agent.api.advice.InstanceMethodAroundAdvice;
import org.apache.shardingsphere.agent.api.result.MethodInvocationResult;
import java.lang.reflect.Method;
@@ -32,20 +31,20 @@ import java.util.List;
@RequiredArgsConstructor
public final class ComposeInstanceMethodAroundAdvice implements InstanceMethodAroundAdvice {
- private final @NonNull List<InstanceMethodAroundAdvice> adviceList;
+ private final List<InstanceMethodAroundAdvice> advices;
@Override
public void beforeMethod(final AdviceTargetObject target, final Method method, final Object[] args, final MethodInvocationResult result) {
- adviceList.forEach(item -> item.beforeMethod(target, method, args, result));
+ advices.forEach(item -> item.beforeMethod(target, method, args, result));
}
@Override
public void afterMethod(final AdviceTargetObject target, final Method method, final Object[] args, final MethodInvocationResult result) {
- adviceList.forEach(item -> item.afterMethod(target, method, args, result));
+ advices.forEach(item -> item.afterMethod(target, method, args, result));
}
@Override
public void onThrowing(final AdviceTargetObject target, final Method method, final Object[] args, final Throwable throwable) {
- adviceList.forEach(item -> item.onThrowing(target, method, args, throwable));
+ advices.forEach(item -> item.onThrowing(target, method, args, throwable));
}
}
diff --git a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeClassStaticMethodAroundInterceptor.java b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeClassStaticMethodAroundInterceptor.java
index fc2b4a7..b85eb0f 100644
--- a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeClassStaticMethodAroundInterceptor.java
+++ b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeClassStaticMethodAroundInterceptor.java
@@ -17,18 +17,15 @@
package org.apache.shardingsphere.agent.core.plugin.interceptor.compose;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.agent.api.advice.ClassStaticMethodAroundAdvice;
-import org.apache.shardingsphere.agent.core.plugin.interceptor.ClassStaticMethodAroundInterceptor;
import org.apache.shardingsphere.agent.core.bytebuddy.transformer.advice.ComposeClassStaticMethodAroundAdvice;
+import org.apache.shardingsphere.agent.core.plugin.interceptor.ClassStaticMethodAroundInterceptor;
-import java.util.List;
+import java.util.Collection;
-@Slf4j
public final class ComposeClassStaticMethodAroundInterceptor extends ClassStaticMethodAroundInterceptor {
- public ComposeClassStaticMethodAroundInterceptor(final List<ClassStaticMethodAroundAdvice> instanceMethodAroundAdvices) {
+ public ComposeClassStaticMethodAroundInterceptor(final Collection<ClassStaticMethodAroundAdvice> instanceMethodAroundAdvices) {
super(new ComposeClassStaticMethodAroundAdvice(instanceMethodAroundAdvices));
}
-
}
diff --git a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeConstructorInterceptor.java b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeConstructorInterceptor.java
index 40c2104..60aac45 100644
--- a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeConstructorInterceptor.java
+++ b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeConstructorInterceptor.java
@@ -17,18 +17,15 @@
package org.apache.shardingsphere.agent.core.plugin.interceptor.compose;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.agent.api.advice.ConstructorAdvice;
import org.apache.shardingsphere.agent.core.bytebuddy.transformer.advice.ComposeConstructorAdvice;
import org.apache.shardingsphere.agent.core.plugin.interceptor.ConstructorInterceptor;
import java.util.List;
-@Slf4j
public final class ComposeConstructorInterceptor extends ConstructorInterceptor {
public ComposeConstructorInterceptor(final List<ConstructorAdvice> constructorAdvices) {
super(new ComposeConstructorAdvice(constructorAdvices));
}
-
}
diff --git a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeInstanceMethodAroundInterceptor.java b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeInstanceMethodAroundInterceptor.java
index 933c598..76588de 100644
--- a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeInstanceMethodAroundInterceptor.java
+++ b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/interceptor/compose/ComposeInstanceMethodAroundInterceptor.java
@@ -17,18 +17,15 @@
package org.apache.shardingsphere.agent.core.plugin.interceptor.compose;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.agent.api.advice.InstanceMethodAroundAdvice;
-import org.apache.shardingsphere.agent.core.plugin.interceptor.InstanceMethodAroundInterceptor;
import org.apache.shardingsphere.agent.core.bytebuddy.transformer.advice.ComposeInstanceMethodAroundAdvice;
+import org.apache.shardingsphere.agent.core.plugin.interceptor.InstanceMethodAroundInterceptor;
import java.util.List;
-@Slf4j
public final class ComposeInstanceMethodAroundInterceptor extends InstanceMethodAroundInterceptor {
public ComposeInstanceMethodAroundInterceptor(final List<InstanceMethodAroundAdvice> instanceMethodAroundAdvices) {
super(new ComposeInstanceMethodAroundAdvice(instanceMethodAroundAdvices));
}
-
}
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/register/PrometheusMetricsRegister.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/register/PrometheusMetricsRegister.java
index 3f1d610..7692219 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/register/PrometheusMetricsRegister.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/register/PrometheusMetricsRegister.java
@@ -20,15 +20,14 @@ package org.apache.shardingsphere.agent.metrics.prometheus.register;
import io.prometheus.client.Counter;
import io.prometheus.client.Gauge;
import io.prometheus.client.Histogram;
+import org.apache.shardingsphere.agent.metrics.api.MetricsRegister;
+
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.agent.metrics.api.MetricsRegister;
/**
* Prometheus metrics register.
*/
-@Slf4j
public final class PrometheusMetricsRegister implements MetricsRegister {
private static final Map<String, Counter> COUNTER_MAP = new ConcurrentHashMap<>();
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLColumnDescription.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLColumnDescription.java
index 405c7c0..6201a0a 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLColumnDescription.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLColumnDescription.java
@@ -18,7 +18,6 @@
package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query;
import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLArrayColumnType;
import org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLBinaryColumnType;
@@ -28,7 +27,6 @@ import java.sql.Types;
* Column description for PostgreSQL.
*/
@Getter
-@Slf4j
public final class PostgreSQLColumnDescription {
private final String columnName;
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-common/src/main/java/org/apache/shardingsphere/db/discovery/common/rule/DatabaseDiscoveryDataSourceRule.java b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-common/src/main/java/org/apache/shardingsphere/db/discovery/common/rule/DatabaseDiscoveryDataSourceRule.java
index 4c90e46..c9b3a46 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-common/src/main/java/org/apache/shardingsphere/db/discovery/common/rule/DatabaseDiscoveryDataSourceRule.java
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-common/src/main/java/org/apache/shardingsphere/db/discovery/common/rule/DatabaseDiscoveryDataSourceRule.java
@@ -20,7 +20,6 @@ package org.apache.shardingsphere.db.discovery.common.rule;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.db.discovery.api.config.rule.DatabaseDiscoveryDataSourceRuleConfiguration;
import org.apache.shardingsphere.db.discovery.spi.DatabaseDiscoveryType;
@@ -36,7 +35,6 @@ import java.util.stream.Collectors;
* Database discovery data source rule.
*/
@Getter
-@Slf4j
public final class DatabaseDiscoveryDataSourceRule {
private final String name;
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/main/java/org/apache/shardingsphere/db/discovery/mgr/MGRHeartbeatJob.java b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/main/java/org/apache/shardingsphere/db/discovery/mgr/MGRHeartbeatJob.java
index 7011fb1..c323d32 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/main/java/org/apache/shardingsphere/db/discovery/mgr/MGRHeartbeatJob.java
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/main/java/org/apache/shardingsphere/db/discovery/mgr/MGRHeartbeatJob.java
@@ -18,10 +18,9 @@
package org.apache.shardingsphere.db.discovery.mgr;
import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.db.discovery.spi.DatabaseDiscoveryType;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
-import org.apache.shardingsphere.db.discovery.spi.DatabaseDiscoveryType;
import javax.sql.DataSource;
import java.util.Collection;
@@ -31,7 +30,6 @@ import java.util.Map;
* MGR heartbeat job.
*/
@RequiredArgsConstructor
-@Slf4j
public final class MGRHeartbeatJob implements SimpleJob {
private final DatabaseDiscoveryType databaseDiscoveryType;
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/callback/RawSQLExecutorCallback.java b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/callback/RawSQLExecutorCallback.java
index 3605ffb..0a3a83a 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/callback/RawSQLExecutorCallback.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/callback/RawSQLExecutorCallback.java
@@ -31,7 +31,6 @@ import java.util.Map;
/**
* Raw SQL executor callback.
*/
-@Slf4j
public final class RawSQLExecutorCallback implements ExecutorCallback<RawSQLExecutionUnit, ExecuteResult> {
static {
diff --git a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/job/check/consistency/AbstractDataConsistencyChecker.java b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/job/check/consistency/AbstractDataConsistencyChecker.java
index e2861a5..e683c5a 100644
--- a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/job/check/consistency/AbstractDataConsistencyChecker.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/job/check/consistency/AbstractDataConsistencyChecker.java
@@ -39,9 +39,9 @@ import java.util.stream.Collectors;
/**
* Abstract data consistency checker.
*/
-@Slf4j
-@Getter
@RequiredArgsConstructor
+@Getter
+@Slf4j
public abstract class AbstractDataConsistencyChecker implements DataConsistencyChecker {
private final DataSourceFactory dataSourceFactory = new DataSourceFactory();
diff --git a/shardingsphere-scaling/shardingsphere-scaling-dialect/shardingsphere-scaling-mysql/src/main/java/org/apache/shardingsphere/scaling/mysql/client/netty/MySQLCommandPacketDecoder.java b/shardingsphere-scaling/shardingsphere-scaling-dialect/shardingsphere-scaling-mysql/src/main/java/org/apache/shardingsphere/scaling/mysql/client/netty/MySQLCommandPacketDecoder.java
index 3b5e11e..dcd9e0d 100644
--- a/shardingsphere-scaling/shardingsphere-scaling-dialect/shardingsphere-scaling-mysql/src/main/java/org/apache/shardingsphere/scaling/mysql/client/netty/MySQLCommandPacketDecoder.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-dialect/shardingsphere-scaling-mysql/src/main/java/org/apache/shardingsphere/scaling/mysql/client/netty/MySQLCommandPacketDecoder.java
@@ -17,6 +17,9 @@
package org.apache.shardingsphere.scaling.mysql.client.netty;
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.handler.codec.ByteToMessageDecoder;
import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLAuthenticationMethod;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.MySQLColumnDefinition41Packet;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.MySQLFieldCountPacket;
@@ -26,18 +29,13 @@ import org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket
import org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLOKPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.handshake.MySQLHandshakePacket;
import org.apache.shardingsphere.db.protocol.mysql.payload.MySQLPacketPayload;
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.handler.codec.ByteToMessageDecoder;
import org.apache.shardingsphere.scaling.mysql.client.InternalResultSet;
-import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* MySQL Command Packet decoder.
*/
-@Slf4j
public final class MySQLCommandPacketDecoder extends ByteToMessageDecoder {
private enum States { ResponsePacket, FieldPacket, RowDataPacket }
diff --git a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-jaeger/src/test/java/org/apache/shardingsphere/integration/agent/test/jaeger/JaegerPluginIT.java b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-jaeger/src/test/java/org/apache/shardingsphere/integration/agent/test/jaeger/JaegerPluginIT.java
index c484331..9ce13a6 100644
--- a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-jaeger/src/test/java/org/apache/shardingsphere/integration/agent/test/jaeger/JaegerPluginIT.java
+++ b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-jaeger/src/test/java/org/apache/shardingsphere/integration/agent/test/jaeger/JaegerPluginIT.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.integration.agent.test.jaeger;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.integration.agent.test.common.entity.OrderEntity;
import org.apache.shardingsphere.integration.agent.test.common.env.IntegrationTestEnvironment;
import org.apache.shardingsphere.integration.agent.test.common.util.JDBCAgentTestUtils;
@@ -28,7 +27,6 @@ import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.List;
-@Slf4j
public final class JaegerPluginIT {
@Test
diff --git a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-zipkin/src/test/java/org/apache/shardingsphere/integration/agent/test/zipkin/ZipkinPluginIT.java b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-zipkin/src/test/java/org/apache/shardingsphere/integration/agent/test/zipkin/ZipkinPluginIT.java
index dd39cd4..a0d8f6a 100644
--- a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-zipkin/src/test/java/org/apache/shardingsphere/integration/agent/test/zipkin/ZipkinPluginIT.java
+++ b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-zipkin/src/test/java/org/apache/shardingsphere/integration/agent/test/zipkin/ZipkinPluginIT.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.integration.agent.test.zipkin;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.integration.agent.test.common.entity.OrderEntity;
import org.apache.shardingsphere.integration.agent.test.common.env.IntegrationTestEnvironment;
import org.apache.shardingsphere.integration.agent.test.common.util.JDBCAgentTestUtils;
@@ -28,7 +27,6 @@ import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.List;
-@Slf4j
public final class ZipkinPluginIT {
@Test
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/env/database/embedded/type/PostgreSQLEmbeddedDatabase.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/env/database/embedded/type/PostgreSQLEmbeddedDatabase.java
index d93f288..1bee0c3 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/env/database/embedded/type/PostgreSQLEmbeddedDatabase.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/env/database/embedded/type/PostgreSQLEmbeddedDatabase.java
@@ -25,9 +25,7 @@ import de.flapdoodle.embed.process.distribution.Platform;
import de.flapdoodle.embed.process.io.directories.FixedPath;
import de.flapdoodle.embed.process.runtime.ICommandLinePostProcessor;
import de.flapdoodle.embed.process.store.PostgresArtifactStoreBuilder;
-import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.test.integration.env.database.embedded.EmbeddedDatabase;
@@ -48,8 +46,6 @@ import java.util.stream.Collectors;
/**
* Embedded database for PostgreSQL.
*/
-@Slf4j
-@RequiredArgsConstructor
public final class PostgreSQLEmbeddedDatabase implements EmbeddedDatabase {
private volatile EmbeddedPostgres embeddedPostgres;
@@ -61,7 +57,7 @@ public final class PostgreSQLEmbeddedDatabase implements EmbeddedDatabase {
DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType(getType());
Version version = detectVersion(embeddedDatabaseProps.getVersion(databaseType));
String extractedDir = new File(cacheDir, "extracted").getPath();
- String instanceDir = new File(cacheDir, "runtime" + File.separator + "PostgreSQL-" + version.name() + File.separator + UUID.randomUUID().toString()).getPath();
+ String instanceDir = new File(cacheDir, "runtime" + File.separator + "PostgreSQL-" + version.name() + File.separator + UUID.randomUUID()).getPath();
embeddedPostgres = new EmbeddedPostgres(version, new File(instanceDir).getPath());
Command cmd = Command.Postgres;
FixedPath extractedCache = new FixedPath(extractedDir);
@@ -118,9 +114,9 @@ public final class PostgreSQLEmbeddedDatabase implements EmbeddedDatabase {
@SneakyThrows
private ICommandLinePostProcessor privilegedWindowsRunasPostprocessor() {
- if (Platform.detect().equals(Platform.Windows)) {
+ if (Platform.detect() == Platform.Windows) {
// Based on https://stackoverflow.com/a/11995662
- final int adminCommandResult = Runtime.getRuntime().exec("net session").waitFor();
+ int adminCommandResult = Runtime.getRuntime().exec("net session").waitFor();
if (adminCommandResult == 0) {
return runWithoutPrivileges();
}
@@ -130,7 +126,7 @@ public final class PostgreSQLEmbeddedDatabase implements EmbeddedDatabase {
private ICommandLinePostProcessor runWithoutPrivileges() {
return (distribution, args) -> {
- if (args.size() > 0 && args.get(0).endsWith("postgres.exe")) {
+ if (!args.isEmpty() && args.get(0).endsWith("postgres.exe")) {
return Arrays.asList("runas", "/trustlevel:0x20000", String.format("\"%s\"", String.join(" ", args)));
}
return args;
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/container/adapter/impl/ShardingSphereJDBCContainer.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/container/adapter/impl/ShardingSphereJDBCContainer.java
index 3dfce72..b170ac2 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/container/adapter/impl/ShardingSphereJDBCContainer.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/container/adapter/impl/ShardingSphereJDBCContainer.java
@@ -17,8 +17,6 @@
package org.apache.shardingsphere.test.integration.junit.container.adapter.impl;
-import lombok.NonNull;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
import org.apache.shardingsphere.test.integration.env.EnvironmentPath;
import org.apache.shardingsphere.test.integration.junit.container.ShardingSphereContainer;
@@ -39,7 +37,6 @@ import java.util.stream.Collectors;
/**
* ShardingSphere JDBC container.
*/
-@Slf4j
public final class ShardingSphereJDBCContainer extends ShardingSphereAdapterContainer {
private final AtomicBoolean isHealthy = new AtomicBoolean();
@@ -80,7 +77,7 @@ public final class ShardingSphereJDBCContainer extends ShardingSphereAdapterCont
}
@Override
- public ShardingSphereContainer waitingFor(final @NonNull WaitStrategy waitStrategy) {
+ public ShardingSphereContainer waitingFor(final WaitStrategy waitStrategy) {
return super.waitingFor(waitStrategy);
}
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/param/ParameterizedArrayFactory.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/param/ParameterizedArrayFactory.java
index 7ef386d..9de09b3 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/param/ParameterizedArrayFactory.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/param/ParameterizedArrayFactory.java
@@ -21,7 +21,6 @@ import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.test.integration.cases.IntegrationTestCaseContext;
@@ -29,10 +28,10 @@ import org.apache.shardingsphere.test.integration.cases.IntegrationTestCasesLoad
import org.apache.shardingsphere.test.integration.cases.SQLCommandType;
import org.apache.shardingsphere.test.integration.cases.assertion.IntegrationTestCaseAssertion;
import org.apache.shardingsphere.test.integration.common.SQLExecuteType;
+import org.apache.shardingsphere.test.integration.env.IntegrationTestEnvironment;
import org.apache.shardingsphere.test.integration.junit.param.model.AssertionParameterizedArray;
import org.apache.shardingsphere.test.integration.junit.param.model.CaseParameterizedArray;
import org.apache.shardingsphere.test.integration.junit.param.model.ParameterizedArray;
-import org.apache.shardingsphere.test.integration.env.IntegrationTestEnvironment;
import java.util.Arrays;
import java.util.Collection;
@@ -45,7 +44,6 @@ import java.util.stream.Collectors;
* Parameterized array factory.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-@Slf4j
public final class ParameterizedArrayFactory {
private static final IntegrationTestCasesLoader TEST_CASES_LOADER = IntegrationTestCasesLoader.getInstance();
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereCISubRunner.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereCISubRunner.java
index aae2f65..6bbf1e6 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereCISubRunner.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereCISubRunner.java
@@ -18,7 +18,6 @@
package org.apache.shardingsphere.test.integration.junit.runner;
import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.test.integration.common.SQLExecuteType;
import org.apache.shardingsphere.test.integration.junit.annotation.ShardingSphereITInject;
import org.apache.shardingsphere.test.integration.junit.compose.ContainerCompose;
@@ -33,7 +32,6 @@ import java.lang.reflect.Field;
/**
* ShardingSphere CI sub runner.
*/
-@Slf4j
public final class ShardingSphereCISubRunner extends BlockJUnit4ClassRunner {
private final TestCaseBeanContext context;
@@ -58,14 +56,14 @@ public final class ShardingSphereCISubRunner extends BlockJUnit4ClassRunner {
compose.setInstance(testInstance);
compose.createContainers();
getTestClass().getAnnotatedFields(ShardingSphereITInject.class)
- .forEach(e -> {
+ .forEach(each -> {
try {
- Field field = e.getField();
+ Field field = each.getField();
field.setAccessible(true);
if (field.getType() == String.class) {
field.set(testInstance, context.getBeanByName(field.getName()));
} else {
- field.set(testInstance, context.getBean(e.getType()));
+ field.set(testInstance, context.getBean(each.getType()));
}
} catch (final IllegalAccessException ex) {
throw new RuntimeException(ex.getMessage(), ex);
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereITSubRunner.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereITSubRunner.java
index b6cec9a..54864dd 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereITSubRunner.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereITSubRunner.java
@@ -18,7 +18,6 @@
package org.apache.shardingsphere.test.integration.junit.runner;
import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.test.integration.common.SQLExecuteType;
import org.apache.shardingsphere.test.integration.junit.annotation.OnContainer;
import org.apache.shardingsphere.test.integration.junit.annotation.ShardingSphereITInject;
@@ -31,7 +30,6 @@ import java.lang.reflect.Field;
/**
* ShardingSphere IT sub runner.
*/
-@Slf4j
public final class ShardingSphereITSubRunner extends BlockJUnit4ClassRunner {
@Getter
@@ -65,25 +63,25 @@ public final class ShardingSphereITSubRunner extends BlockJUnit4ClassRunner {
protected void autowired(final Object testInstance) {
getTestClass().getAnnotatedFields(ShardingSphereITInject.class)
- .forEach(e -> {
+ .forEach(each -> {
try {
- Field field = e.getField();
+ Field field = each.getField();
field.setAccessible(true);
if (field.getType() == String.class) {
field.set(testInstance, context.getBeanByName(field.getName()));
} else {
- field.set(testInstance, context.getBean(e.getType()));
+ field.set(testInstance, context.getBean(each.getType()));
}
} catch (final IllegalAccessException ex) {
throw new RuntimeException(ex.getMessage(), ex);
}
});
- getTestClass().getAnnotatedFields(OnContainer.class).forEach(e -> {
- OnContainer container = e.getAnnotation(OnContainer.class);
- Object c = context.getBeanByName(container.name());
+ getTestClass().getAnnotatedFields(OnContainer.class).forEach(each -> {
+ OnContainer onContainer = each.getAnnotation(OnContainer.class);
+ Object container = context.getBeanByName(onContainer.name());
try {
- e.getField().setAccessible(true);
- e.getField().set(testInstance, c);
+ each.getField().setAccessible(true);
+ each.getField().set(testInstance, container);
} catch (final IllegalAccessException ex) {
throw new RuntimeException(ex);
}
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereRunner.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereRunner.java
index b14f673..ac62cc5 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereRunner.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/runner/ShardingSphereRunner.java
@@ -20,7 +20,6 @@ package org.apache.shardingsphere.test.integration.junit.runner;
import com.google.common.base.Strings;
import lombok.Getter;
import lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.test.integration.cases.IntegrationTestCasesLoader;
import org.apache.shardingsphere.test.integration.cases.assertion.IntegrationTestCase;
import org.apache.shardingsphere.test.integration.cases.assertion.IntegrationTestCaseAssertion;
@@ -52,7 +51,6 @@ import java.util.Objects;
import java.util.function.Predicate;
import java.util.stream.Collectors;
-@Slf4j
public final class ShardingSphereRunner extends Suite {
private final List<Runner> runners;
@@ -153,19 +151,19 @@ public final class ShardingSphereRunner extends Suite {
private Predicate<TestCaseBeanContext> createTestCaseParametersPredicate() {
ParameterFilter filter = getTestClass().getAnnotation(ParameterFilter.class);
- Predicate<TestCaseBeanContext> predicate;
+ Predicate<TestCaseBeanContext> result;
if (Objects.nonNull(filter)) {
Class<? extends ParameterFilter.Filter> filtered = filter.filter();
try {
ParameterFilter.Filter instance = filtered.newInstance();
- predicate = instance::filter;
+ result = instance::filter;
} catch (InstantiationException | IllegalAccessException ex) {
throw new RuntimeException(ex);
}
} else {
- predicate = parameters -> true;
+ result = parameters -> true;
}
- return predicate;
+ return result;
}
private Collection<ParameterizedArray> allCIParameters(final TestCaseSpec testCaseSpec) {
@@ -200,10 +198,10 @@ public final class ShardingSphereRunner extends Suite {
private Collection<TestCaseParameters> getAssertionParameters(final Class<?> klass, final TestCaseDescription description) {
IntegrationTestCasesLoader testCasesLoader = IntegrationTestCasesLoader.getInstance();
return testCasesLoader.getTestCaseContexts(description.getSqlCommandType()).stream()
- .filter(e -> assertThan(e.getTestCase().getDbTypes(), description.getDatabase()))
- .filter(e -> assertThan(e.getTestCase().getScenarioTypes(), description.getScenario()))
- .flatMap(e -> Arrays.stream(SQLExecuteType.values()).flatMap(type -> e.getTestCase().getAssertions().stream()
- .map(a -> new TestCaseParameters(getCaseName(), e.getParentPath(), e.getTestCase().getSql(), type, klass, e.getTestCase(), a)))
+ .filter(each -> assertThan(each.getTestCase().getDbTypes(), description.getDatabase()))
+ .filter(each -> assertThan(each.getTestCase().getScenarioTypes(), description.getScenario()))
+ .flatMap(each -> Arrays.stream(SQLExecuteType.values()).flatMap(type -> each.getTestCase().getAssertions().stream()
+ .map(a -> new TestCaseParameters(caseName, each.getParentPath(), each.getTestCase().getSql(), type, klass, each.getTestCase(), a)))
).collect(Collectors.toList());
}
@@ -226,10 +224,10 @@ public final class ShardingSphereRunner extends Suite {
private Collection<TestCaseParameters> getCaseParameters(final Class<?> klass, final TestCaseDescription description) {
IntegrationTestCasesLoader testCasesLoader = IntegrationTestCasesLoader.getInstance();
return testCasesLoader.getTestCaseContexts(description.getSqlCommandType()).stream()
- .filter(e -> assertThan(e.getTestCase().getDbTypes(), description.getDatabase()))
- .filter(e -> assertThan(e.getTestCase().getScenarioTypes(), description.getScenario()))
- .flatMap(e -> Arrays.stream(SQLExecuteType.values())
- .map(type -> new TestCaseParameters(getCaseName(), e.getParentPath(), e.getTestCase().getSql(), type, klass, e.getTestCase(), null)))
+ .filter(each -> assertThan(each.getTestCase().getDbTypes(), description.getDatabase()))
+ .filter(each -> assertThan(each.getTestCase().getScenarioTypes(), description.getScenario()))
+ .flatMap(each -> Arrays.stream(SQLExecuteType.values())
+ .map(type -> new TestCaseParameters(caseName, each.getParentPath(), each.getTestCase().getSql(), type, klass, each.getTestCase(), null)))
.collect(Collectors.toList());
}
@@ -239,7 +237,7 @@ public final class ShardingSphereRunner extends Suite {
}
protected Statement withBeforeClasses(final Statement statement) {
- if (getChildren().isEmpty()) {
+ if (runners.isEmpty()) {
return super.withBeforeClasses(statement);
}
return super.withBeforeClasses(new Statement() {
@@ -253,7 +251,7 @@ public final class ShardingSphereRunner extends Suite {
private void beforeAllClasses() throws Exception {
List<FrameworkMethod> methods = getTestClass().getAnnotatedMethods(BeforeAllCases.class);
- List<Runner> children = getChildren();
+ List<Runner> children = runners;
if (!children.isEmpty()) {
Runner runner = children.get(0);
Object testInstance;
@@ -269,10 +267,10 @@ public final class ShardingSphereRunner extends Suite {
} else {
testInstance = ((ShardingSphereCISubRunner) runner).createTest();
}
- methods.forEach(e -> {
- e.getMethod().setAccessible(true);
+ methods.forEach(each -> {
+ each.getMethod().setAccessible(true);
try {
- e.invokeExplosively(testInstance);
+ each.invokeExplosively(testInstance);
// CHECKSTYLE:OFF
} catch (final Throwable throwable) {
// CHECKSTYLE:ON
diff --git a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/manager/XATransactionManagerLoader.java b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/manager/XATransactionManagerLoader.java
index 7461ac4..e5723ae 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/manager/XATransactionManagerLoader.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/manager/XATransactionManagerLoader.java
@@ -17,24 +17,22 @@
package org.apache.shardingsphere.transaction.xa.manager;
-import java.util.Iterator;
-import java.util.ServiceLoader;
-import lombok.extern.slf4j.Slf4j;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
import org.apache.shardingsphere.transaction.xa.atomikos.manager.AtomikosTransactionManager;
import org.apache.shardingsphere.transaction.xa.spi.XATransactionManager;
+import java.util.Iterator;
+import java.util.ServiceLoader;
+
/**
* XA transaction manager loader.
*/
-@Slf4j
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class XATransactionManagerLoader {
private static final XATransactionManagerLoader INSTANCE = new XATransactionManagerLoader();
- private XATransactionManagerLoader() {
- }
-
-
/**
* Get instance of XA transaction manager SPI loader.
*