You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by su...@apache.org on 2024/05/19 06:48:27 UTC
(shardingsphere) branch master updated: Fix sonar issues (#31288)
This is an automated email from the ASF dual-hosted git repository.
sunnianjun 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 37b02493108 Fix sonar issues (#31288)
37b02493108 is described below
commit 37b02493108313e1dbc113ef646654601174f0b5
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sun May 19 14:48:20 2024 +0800
Fix sonar issues (#31288)
* Fix sonar issues
* Fix sonar issues
---
.../apache/shardingsphere/mode/subsciber/EventSubscriberRegistry.java | 2 +-
.../external/loader/PrestoExternalTestParameterLoadTemplate.java | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/EventSubscriberRegistry.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/EventSubscriberRegistry.java
index cde56c69cf1..18da4f27a7d 100644
--- a/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/EventSubscriberRegistry.java
+++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/EventSubscriberRegistry.java
@@ -33,7 +33,7 @@ public abstract class EventSubscriberRegistry {
private final Collection<EventSubscriber> subscribers;
- public EventSubscriberRegistry(final ContextManager contextManager, final EventSubscriber... subscribers) {
+ protected EventSubscriberRegistry(final ContextManager contextManager, final EventSubscriber... subscribers) {
eventBusContext = contextManager.getInstanceContext().getEventBusContext();
this.subscribers = Arrays.asList(subscribers);
}
diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/external/loader/PrestoExternalTestParameterLoadTemplate.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/external/loader/PrestoExternalTestParameterLoadTemplate.java
index b0e10d809a7..86aa5f1e78b 100644
--- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/external/loader/PrestoExternalTestParameterLoadTemplate.java
+++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/external/loader/PrestoExternalTestParameterLoadTemplate.java
@@ -31,6 +31,8 @@ import java.util.stream.Collectors;
*/
public final class PrestoExternalTestParameterLoadTemplate implements TestParameterLoadTemplate {
+ private static final String REGEX = "\\$\\{mutableTables.hive.datatype}";
+
@Override
public Collection<ExternalSQLTestParameter> load(final String sqlCaseFileName, final List<String> sqlCaseFileContent, final List<String> resultFileContent,
final String databaseType, final String reportType) {
@@ -69,6 +71,6 @@ public final class PrestoExternalTestParameterLoadTemplate implements TestParame
}
}
}
- return result.stream().map(each -> each.replaceAll("\\$\\{mutableTables.hive.datatype}", "a")).collect(Collectors.toList());
+ return result.stream().map(each -> each.replaceAll(REGEX, "a")).collect(Collectors.toList());
}
}