[SCB-2579] enable checkstyle ParenPad (#3093)
diff --git a/ci/checkstyle/checkstyle.xml b/ci/checkstyle/checkstyle.xml
index 311f255..9684dc3 100644
--- a/ci/checkstyle/checkstyle.xml
+++ b/ci/checkstyle/checkstyle.xml
@@ -61,6 +61,12 @@
<property name="allowLineBreaks" value="true"/>
<property name="severity" value="error"/>
</module>
+ <module name="ParenPad">
+ <!-- Checks that there is no whitespace before close parens or after
+ open parens.
+ -->
+ <property name="severity" value="error"/>
+ </module>
<!-- Checks for over-complicated boolean expressions. -->
<module name="SimplifyBooleanExpression"/>
<module name="RedundantImport"/>
diff --git a/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/event/TestEventBus.java b/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/event/TestEventBus.java
index 8f7829c..68cac74 100644
--- a/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/event/TestEventBus.java
+++ b/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/event/TestEventBus.java
@@ -35,7 +35,7 @@
public static class SubscriberForTest {
private final List<Object> events;
- public SubscriberForTest( List<Object> events) {
+ public SubscriberForTest(List<Object> events) {
this.events = events;
}
@Subscribe
@@ -53,7 +53,7 @@
public static class SubscriberWithOrderForTest {
private final List<Object> events;
- public SubscriberWithOrderForTest( List<Object> events) {
+ public SubscriberWithOrderForTest(List<Object> events) {
this.events = events;
}
diff --git a/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/registry/cache/RefreshableMicroserviceCache.java b/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/registry/cache/RefreshableMicroserviceCache.java
index 9124a66..03b6fb1 100644
--- a/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/registry/cache/RefreshableMicroserviceCache.java
+++ b/service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/registry/cache/RefreshableMicroserviceCache.java
@@ -226,10 +226,8 @@
private boolean microserviceMatched(MicroserviceInstanceChangedEvent event) {
return (key.getAppId().equals(event.getKey().getAppId())) // appId matched
- && ( // microserviceName matched
- key.getServiceName().equals(event.getKey().getServiceName())
- || key.getServiceName().equals(
- event.getKey().getAppId() + DefinitionConst.APP_SERVICE_SEPARATOR + event.getKey().getServiceName()
- ));
+ && (key.getServiceName().equals(event.getKey().getServiceName()) // microserviceName matched
+ || key.getServiceName().equals(event.getKey().getAppId() + DefinitionConst.APP_SERVICE_SEPARATOR + event.getKey().getServiceName()
+ ));
}
}