From de9b1be4bef07b1d78a04d68077a60f8864e5742 Mon Sep 17 00:00:00 2001 From: fangjian0423 Date: Mon, 28 Oct 2019 16:15:18 +0800 Subject: [PATCH] pass checkstyle plugin --- eclipse/checkstyle-suppressions.xml | 8 ++++++++ pom.xml | 18 ++++++++++++++++++ ...rviceRegistrationAutoConfigurationTest.java | 2 +- .../AbstractMediaTypeExpressionTest.java | 2 +- .../alibaba/cloud/examples/OssApplication.java | 3 +++ .../java/com/alibaba/cloud/examples/Order.java | 15 +++++++++++++++ .../java/com/alibaba/cloud/examples/Order.java | 15 +++++++++++++++ .../alibaba/cloud/examples/ExceptionUtil.java | 6 +++++- .../examples/fallback/EchoServiceFallback.java | 2 +- .../cloud/examples/service/EchoService.java | 4 ++-- .../rocketmq/RocketMQBusApplication.java | 4 ++-- .../bootstrap/NacosConfigServerBootstrap.java | 2 +- .../cloud/nacos/test/NacosMockTest.java | 6 +++++- .../sentinel/ContextIdSentinelFeignTests.java | 2 +- .../alibaba/alicloud/ans/test/AnsMockTest.java | 6 +++++- .../context/oss/OssAutoConfigurationTests.java | 2 +- 16 files changed, 84 insertions(+), 13 deletions(-) create mode 100644 eclipse/checkstyle-suppressions.xml diff --git a/eclipse/checkstyle-suppressions.xml b/eclipse/checkstyle-suppressions.xml new file mode 100644 index 000000000..a83004af1 --- /dev/null +++ b/eclipse/checkstyle-suppressions.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index cc677ad22..b1ad7acb1 100644 --- a/pom.xml +++ b/pom.xml @@ -282,6 +282,24 @@ org.apache.maven.plugins maven-checkstyle-plugin + + + checkstyle-validation + validate + + check + + + + eclipse/checkstyle-suppressions.xml + true + true + true + true + warning + + + org.apache.maven.plugins diff --git a/spring-cloud-alibaba-dubbo/src/test/java/com/alibaba/cloud/dubbo/autoconfigure/DubboServiceRegistrationAutoConfigurationTest.java b/spring-cloud-alibaba-dubbo/src/test/java/com/alibaba/cloud/dubbo/autoconfigure/DubboServiceRegistrationAutoConfigurationTest.java index b3fa84d6f..0fac7ac24 100644 --- a/spring-cloud-alibaba-dubbo/src/test/java/com/alibaba/cloud/dubbo/autoconfigure/DubboServiceRegistrationAutoConfigurationTest.java +++ b/spring-cloud-alibaba-dubbo/src/test/java/com/alibaba/cloud/dubbo/autoconfigure/DubboServiceRegistrationAutoConfigurationTest.java @@ -19,7 +19,7 @@ package com.alibaba.cloud.dubbo.autoconfigure; import org.springframework.boot.test.context.SpringBootTest; /** - * {@link DubboServiceRegistrationAutoConfiguration} Test + * {@link DubboServiceRegistrationAutoConfiguration} Test. * * @author Mercy */ diff --git a/spring-cloud-alibaba-dubbo/src/test/java/com/alibaba/cloud/dubbo/http/matcher/AbstractMediaTypeExpressionTest.java b/spring-cloud-alibaba-dubbo/src/test/java/com/alibaba/cloud/dubbo/http/matcher/AbstractMediaTypeExpressionTest.java index e45c040fc..c38b5ba69 100644 --- a/spring-cloud-alibaba-dubbo/src/test/java/com/alibaba/cloud/dubbo/http/matcher/AbstractMediaTypeExpressionTest.java +++ b/spring-cloud-alibaba-dubbo/src/test/java/com/alibaba/cloud/dubbo/http/matcher/AbstractMediaTypeExpressionTest.java @@ -26,7 +26,7 @@ import org.springframework.core.ResolvableType; import org.springframework.http.MediaType; /** - * {@link AbstractMediaTypeExpression} Test + * {@link AbstractMediaTypeExpression} Test. * * @author Mercy */ diff --git a/spring-cloud-alibaba-examples/oss-example/src/main/java/com/alibaba/cloud/examples/OssApplication.java b/spring-cloud-alibaba-examples/oss-example/src/main/java/com/alibaba/cloud/examples/OssApplication.java index 0e3f7b8a4..678d7551e 100644 --- a/spring-cloud-alibaba-examples/oss-example/src/main/java/com/alibaba/cloud/examples/OssApplication.java +++ b/spring-cloud-alibaba-examples/oss-example/src/main/java/com/alibaba/cloud/examples/OssApplication.java @@ -35,6 +35,9 @@ import org.springframework.context.annotation.Bean; @SpringBootApplication public class OssApplication { + /** + * Bucket Name of OSS Example. + */ public static final String BUCKET_NAME = "spring-cloud-alibaba-test"; public static void main(String[] args) throws URISyntaxException { diff --git a/spring-cloud-alibaba-examples/seata-example/business-service/src/main/java/com/alibaba/cloud/examples/Order.java b/spring-cloud-alibaba-examples/seata-example/business-service/src/main/java/com/alibaba/cloud/examples/Order.java index 06ecbde48..fbcb8391d 100644 --- a/spring-cloud-alibaba-examples/seata-example/business-service/src/main/java/com/alibaba/cloud/examples/Order.java +++ b/spring-cloud-alibaba-examples/seata-example/business-service/src/main/java/com/alibaba/cloud/examples/Order.java @@ -20,14 +20,29 @@ import java.io.Serializable; public class Order implements Serializable { + /** + * order id. + */ public long id; + /** + * user id. + */ public String userId; + /** + * commodity code. + */ public String commodityCode; + /** + * count. + */ public int count; + /** + * money. + */ public int money; @Override diff --git a/spring-cloud-alibaba-examples/seata-example/order-service/src/main/java/com/alibaba/cloud/examples/Order.java b/spring-cloud-alibaba-examples/seata-example/order-service/src/main/java/com/alibaba/cloud/examples/Order.java index 06ecbde48..6ad92cc5b 100644 --- a/spring-cloud-alibaba-examples/seata-example/order-service/src/main/java/com/alibaba/cloud/examples/Order.java +++ b/spring-cloud-alibaba-examples/seata-example/order-service/src/main/java/com/alibaba/cloud/examples/Order.java @@ -20,14 +20,29 @@ import java.io.Serializable; public class Order implements Serializable { + /** + * id. + */ public long id; + /** + * user id. + */ public String userId; + /** + * commodity code. + */ public String commodityCode; + /** + * count. + */ public int count; + /** + * money. + */ public int money; @Override diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/src/main/java/com/alibaba/cloud/examples/ExceptionUtil.java b/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/src/main/java/com/alibaba/cloud/examples/ExceptionUtil.java index ef41bda9a..591756f80 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/src/main/java/com/alibaba/cloud/examples/ExceptionUtil.java +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/src/main/java/com/alibaba/cloud/examples/ExceptionUtil.java @@ -25,7 +25,11 @@ import org.springframework.http.client.ClientHttpRequestExecution; /** * @author fangjian */ -public class ExceptionUtil { +public final class ExceptionUtil { + + private ExceptionUtil() { + + } public static SentinelClientHttpResponse handleException(HttpRequest request, byte[] body, ClientHttpRequestExecution execution, BlockException ex) { diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/src/main/java/com/alibaba/cloud/examples/fallback/EchoServiceFallback.java b/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/src/main/java/com/alibaba/cloud/examples/fallback/EchoServiceFallback.java index 3b3afc007..30a9de2be 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/src/main/java/com/alibaba/cloud/examples/fallback/EchoServiceFallback.java +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/src/main/java/com/alibaba/cloud/examples/fallback/EchoServiceFallback.java @@ -33,7 +33,7 @@ public class EchoServiceFallback implements EchoService { } /** - * 调用服务提供方的输出接口 + * 调用服务提供方的输出接口. * @param str 用户输入 * @return */ diff --git a/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/src/main/java/com/alibaba/cloud/examples/service/EchoService.java b/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/src/main/java/com/alibaba/cloud/examples/service/EchoService.java index 120e711cc..4e0da067b 100644 --- a/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/src/main/java/com/alibaba/cloud/examples/service/EchoService.java +++ b/spring-cloud-alibaba-examples/sentinel-example/sentinel-feign-example/sentinel-feign-consumer-example/src/main/java/com/alibaba/cloud/examples/service/EchoService.java @@ -33,9 +33,9 @@ import org.springframework.web.bind.annotation.PathVariable; public interface EchoService { /** - * 调用服务提供方的输出接口 + * 调用服务提供方的输出接口. * @param str 用户输入 - * @return + * @return echo result */ @GetMapping("/echo/{str}") String echo(@PathVariable("str") String str); diff --git a/spring-cloud-alibaba-examples/spring-cloud-bus-rocketmq-example/src/main/java/com/alibaba/cloud/examples/rocketmq/RocketMQBusApplication.java b/spring-cloud-alibaba-examples/spring-cloud-bus-rocketmq-example/src/main/java/com/alibaba/cloud/examples/rocketmq/RocketMQBusApplication.java index eff0e4fb8..91a3ffb35 100644 --- a/spring-cloud-alibaba-examples/spring-cloud-bus-rocketmq-example/src/main/java/com/alibaba/cloud/examples/rocketmq/RocketMQBusApplication.java +++ b/spring-cloud-alibaba-examples/spring-cloud-bus-rocketmq-example/src/main/java/com/alibaba/cloud/examples/rocketmq/RocketMQBusApplication.java @@ -65,7 +65,7 @@ public class RocketMQBusApplication { private ObjectMapper objectMapper; /** - * Publish the {@link UserRemoteApplicationEvent} + * Publish the {@link UserRemoteApplicationEvent}. * @param name the user name * @param destination the destination * @return If published @@ -82,7 +82,7 @@ public class RocketMQBusApplication { } /** - * Listener on the {@link UserRemoteApplicationEvent} + * Listener on the {@link UserRemoteApplicationEvent}. * @param event {@link UserRemoteApplicationEvent} */ @EventListener diff --git a/spring-cloud-alibaba-nacos-config-server/src/test/java/com/alibaba/cloud/nacos/config/server/bootstrap/NacosConfigServerBootstrap.java b/spring-cloud-alibaba-nacos-config-server/src/test/java/com/alibaba/cloud/nacos/config/server/bootstrap/NacosConfigServerBootstrap.java index 2ff7dc1c2..cba01073f 100644 --- a/spring-cloud-alibaba-nacos-config-server/src/test/java/com/alibaba/cloud/nacos/config/server/bootstrap/NacosConfigServerBootstrap.java +++ b/spring-cloud-alibaba-nacos-config-server/src/test/java/com/alibaba/cloud/nacos/config/server/bootstrap/NacosConfigServerBootstrap.java @@ -23,7 +23,7 @@ import org.springframework.cloud.config.server.EnableConfigServer; import org.springframework.context.annotation.Bean; /** - * Nacos Config Server Bootstrap + * Nacos Config Server Bootstrap. * * @author Mercy * @since 0.2.0 diff --git a/spring-cloud-alibaba-nacos-discovery/src/test/java/com/alibaba/cloud/nacos/test/NacosMockTest.java b/spring-cloud-alibaba-nacos-discovery/src/test/java/com/alibaba/cloud/nacos/test/NacosMockTest.java index 684ab749d..a541fd23f 100644 --- a/spring-cloud-alibaba-nacos-discovery/src/test/java/com/alibaba/cloud/nacos/test/NacosMockTest.java +++ b/spring-cloud-alibaba-nacos-discovery/src/test/java/com/alibaba/cloud/nacos/test/NacosMockTest.java @@ -24,7 +24,11 @@ import com.alibaba.nacos.api.naming.pojo.Instance; /** * @author xiaojing */ -public class NacosMockTest { +public final class NacosMockTest { + + private NacosMockTest() { + + } public static Instance serviceInstance(String serviceName, boolean isHealthy, Map metadata) { diff --git a/spring-cloud-alibaba-sentinel/src/test/java/com/alibaba/cloud/sentinel/ContextIdSentinelFeignTests.java b/spring-cloud-alibaba-sentinel/src/test/java/com/alibaba/cloud/sentinel/ContextIdSentinelFeignTests.java index f6996fdbc..7bd67724b 100644 --- a/spring-cloud-alibaba-sentinel/src/test/java/com/alibaba/cloud/sentinel/ContextIdSentinelFeignTests.java +++ b/spring-cloud-alibaba-sentinel/src/test/java/com/alibaba/cloud/sentinel/ContextIdSentinelFeignTests.java @@ -37,7 +37,7 @@ import org.springframework.web.bind.annotation.RequestParam; import static org.assertj.core.api.Assertions.assertThat; /** - * Add this unit test to verify https://github.com/alibaba/spring-cloud-alibaba/pull/838 + * Add this unit test to verify https://github.com/alibaba/spring-cloud-alibaba/pull/838. * * @author Jim */ diff --git a/spring-cloud-alicloud-ans/src/test/java/com/alibaba/alicloud/ans/test/AnsMockTest.java b/spring-cloud-alicloud-ans/src/test/java/com/alibaba/alicloud/ans/test/AnsMockTest.java index 694672f85..0b18f41e3 100644 --- a/spring-cloud-alicloud-ans/src/test/java/com/alibaba/alicloud/ans/test/AnsMockTest.java +++ b/spring-cloud-alicloud-ans/src/test/java/com/alibaba/alicloud/ans/test/AnsMockTest.java @@ -23,7 +23,11 @@ import com.alibaba.ans.shaded.com.taobao.vipserver.client.core.Host; /** * @author xiaojing */ -public class AnsMockTest { +public final class AnsMockTest { + + private AnsMockTest() { + + } public static Host hostInstance(String serviceName, boolean valid, Map metadata) { diff --git a/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/oss/OssAutoConfigurationTests.java b/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/oss/OssAutoConfigurationTests.java index 5195cbe03..0772e30e1 100644 --- a/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/oss/OssAutoConfigurationTests.java +++ b/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/oss/OssAutoConfigurationTests.java @@ -27,7 +27,7 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner; import static org.assertj.core.api.Assertions.assertThat; /** - * {@link OSS} {@link OssProperties} Test + * {@link OSS} {@link OssProperties} Test. * * @author Jim */