From 1a0b7316fe587ab844cafd3bd40e5f541f0b4a4e Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 27 Apr 2024 19:02:19 +0800 Subject: [PATCH] Remove useless @SuppressWarnings("UnstableApiUsage") (#31032) * Code format for test cases * Code format for test cases * Code format for test cases * Code format for test cases * Remove useless @SuppressWarnings("UnstableApiUsage") --- .../shardingsphere/infra/util/eventbus/EventBusContext.java | 1 - .../infra/util/eventbus/fixture/EventListenerFixture.java | 2 +- .../mode/subsciber/RuleItemChangedSubscriber.java | 4 ++-- .../ShardingSphereSchemaDataRegistrySubscriber.java | 1 - .../registry/process/subscriber/ClusterProcessSubscriber.java | 1 - .../status/cluster/subscriber/ClusterStatusSubscriber.java | 1 - .../standalone/subscriber/StandaloneProcessSubscriber.java | 1 - .../mysql/handler/admin/executor/ShowProcessListExecutor.java | 2 +- 8 files changed, 4 insertions(+), 9 deletions(-) diff --git a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java index 974989b8d91d5..482934358312f 100644 --- a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java +++ b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java @@ -23,7 +23,6 @@ /** * Event bus context. */ -@SuppressWarnings("UnstableApiUsage") public final class EventBusContext { private final EventBus eventBus = new EventBus(); diff --git a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventListenerFixture.java b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventListenerFixture.java index f90d6de038022..76f04b6f50ff7 100644 --- a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventListenerFixture.java +++ b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventListenerFixture.java @@ -23,7 +23,6 @@ import java.util.LinkedList; import java.util.List; -@SuppressWarnings("UnstableApiUsage") @Getter public final class EventListenerFixture { @@ -34,6 +33,7 @@ public final class EventListenerFixture { * * @param event event */ + @SuppressWarnings("unused") @Subscribe public void listen(final String event) { events.add(event); diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/RuleItemChangedSubscriber.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/RuleItemChangedSubscriber.java index b88030183f190..4eb874552df1f 100644 --- a/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/RuleItemChangedSubscriber.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/RuleItemChangedSubscriber.java @@ -42,7 +42,7 @@ public final class RuleItemChangedSubscriber { * * @param event alter rule item event */ - @SuppressWarnings({"UnstableApiUsage", "rawtypes", "unchecked"}) + @SuppressWarnings({"rawtypes", "unchecked", "unused"}) @Subscribe public void renew(final AlterRuleItemEvent event) { if (!event.getActiveVersion().equals(contextManager.getMetaDataContexts().getPersistService().getMetaDataVersionPersistService().getActiveVersionByFullPath(event.getActiveVersionKey()))) { @@ -69,7 +69,7 @@ public void renew(final AlterRuleItemEvent event) { * * @param event drop rule item event */ - @SuppressWarnings({"UnstableApiUsage", "rawtypes", "unchecked"}) + @SuppressWarnings({"rawtypes", "unchecked", "unused"}) @Subscribe public void renew(final DropRuleItemEvent event) { if (!contextManager.getMetaDataContexts().getMetaData().containsDatabase(event.getDatabaseName())) { diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/metadata/subscriber/ShardingSphereSchemaDataRegistrySubscriber.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/metadata/subscriber/ShardingSphereSchemaDataRegistrySubscriber.java index 7efc3f240087b..6ec93b79cc925 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/metadata/subscriber/ShardingSphereSchemaDataRegistrySubscriber.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/metadata/subscriber/ShardingSphereSchemaDataRegistrySubscriber.java @@ -26,7 +26,6 @@ /** * ShardingSphere schema data registry subscriber. */ -@SuppressWarnings("UnstableApiUsage") public final class ShardingSphereSchemaDataRegistrySubscriber { private final ShardingSphereDataPersistService persistService; diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ClusterProcessSubscriber.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ClusterProcessSubscriber.java index ae546387a8b4a..6b23cd3d2cd23 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ClusterProcessSubscriber.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ClusterProcessSubscriber.java @@ -41,7 +41,6 @@ /** * Cluster process subscriber. */ -@SuppressWarnings("UnstableApiUsage") public final class ClusterProcessSubscriber implements ProcessSubscriber { private final PersistRepository repository; diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/cluster/subscriber/ClusterStatusSubscriber.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/cluster/subscriber/ClusterStatusSubscriber.java index 45f5b9c044b75..2a0ea7d776500 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/cluster/subscriber/ClusterStatusSubscriber.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/cluster/subscriber/ClusterStatusSubscriber.java @@ -26,7 +26,6 @@ /** * Cluster status subscriber. */ -@SuppressWarnings("UnstableApiUsage") public final class ClusterStatusSubscriber { private final ClusterPersistRepository repository; diff --git a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/subscriber/StandaloneProcessSubscriber.java b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/subscriber/StandaloneProcessSubscriber.java index 88033a0dd9aa8..95081a3549f26 100644 --- a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/subscriber/StandaloneProcessSubscriber.java +++ b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/subscriber/StandaloneProcessSubscriber.java @@ -32,7 +32,6 @@ /** * Standalone process subscriber. */ -@SuppressWarnings("UnstableApiUsage") public final class StandaloneProcessSubscriber implements ProcessSubscriber { private final EventBusContext eventBusContext; diff --git a/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutor.java b/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutor.java index 34f975b2b4fdd..4fdaa73c79e4c 100644 --- a/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutor.java +++ b/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutor.java @@ -45,7 +45,6 @@ /** * Show process list executor. */ -@SuppressWarnings("UnstableApiUsage") public final class ShowProcessListExecutor implements DatabaseAdminQueryExecutor { private final boolean showFullProcesslist; @@ -68,6 +67,7 @@ public ShowProcessListExecutor(final boolean showFullProcesslist) { * * @param event show process list response event */ + @SuppressWarnings("unused") @Subscribe public void receiveProcessListData(final ShowProcessListResponseEvent event) { processes = event.getProcesses();