Repository: apache/rocketmq (Java)
Task: Refactoring (2023-10-01 10:41:09+00:00)

Issue:
[Enhancement]  Optimization Method Name
### Before Creating the Enhancement Request

- [X] I have confirmed that this should be classified as an enhancement rather than a bug/feature.


### Summary
**path:** org.apache.rocketmq.tieredstore.provider.TieredStoreTopicBlackListFilter

The method addTopicToWhiteList of this TieredStoreTopicBlackListFilter class should be renamed to addTopicToBlackList
![image](https://github.com/apache/rocketmq/assets/44110731/c1d5757b-a3db-4412-bd4f-e4e309884bd6)


### Motivation

I found that the method name does not match the actual logic of the method

### Describe the Solution You'd Like

Modify Method Name

### Describe Alternatives You've Considered

Modify Method Name

### Additional Context

_No response_


Discussion:
Hii
I want to work on this.
This is my first issue working on,  I wanna give a try.



Patch:
diff --git a/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicBlackListFilter.java b/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicBlackListFilter.java
--- a/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicBlackListFilter.java
+++ b/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicBlackListFilter.java
@@ -39,7 +39,7 @@ public boolean filterTopic(String topicName) {
     }
 
     @Override
-    public void addTopicToWhiteList(String topicName) {
+    public void addTopicToBlackList(String topicName) {
         this.topicBlackSet.add(topicName);
     }
 }
diff --git a/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicFilter.java b/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicFilter.java
--- a/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicFilter.java
+++ b/tieredstore/src/main/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicFilter.java
@@ -21,5 +21,5 @@ public interface TieredStoreTopicFilter {
 
     boolean filterTopic(String topicName);
 
-    void addTopicToWhiteList(String topicName);
+    void addTopicToBlackList(String topicName);
 }


Test patch:
diff --git a/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicBlackListFilterTest.java b/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicBlackListFilterTest.java
--- a/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicBlackListFilterTest.java
+++ b/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/provider/TieredStoreTopicBlackListFilterTest.java
@@ -30,7 +30,7 @@ public void filterTopicTest() {
 
         String topicName = "WhiteTopic";
         Assert.assertFalse(topicFilter.filterTopic(topicName));
-        topicFilter.addTopicToWhiteList(topicName);
+        topicFilter.addTopicToBlackList(topicName);
         Assert.assertTrue(topicFilter.filterTopic(topicName));
     }
 }
\ No newline at end of file