From 60d02121f0f5e98da7b36e867d580f310734aa77 Mon Sep 17 00:00:00 2001 From: huzongtang Date: Mon, 14 Oct 2019 10:56:59 +0800 Subject: [PATCH] polish codes for updateTopicPermSubCommand. --- .../tools/command/topic/UpdateTopicPermSubCommand.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicPermSubCommand.java b/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicPermSubCommand.java index 3c23bf3d..08dce1b9 100644 --- a/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicPermSubCommand.java +++ b/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicPermSubCommand.java @@ -107,7 +107,6 @@ public class UpdateTopicPermSubCommand implements SubCommand { if (commandLine.hasOption('b')) { String brokerAddr = commandLine.getOptionValue('b').trim(); List brokerDatas = topicRouteData.getBrokerDatas(); - boolean isBrokerLegal = false; String brokerName = null; for (BrokerData data : brokerDatas) { HashMap brokerAddrs = data.getBrokerAddrs(); @@ -116,17 +115,16 @@ public class UpdateTopicPermSubCommand implements SubCommand { } for (Map.Entry entry : brokerAddrs.entrySet()) { if (brokerAddr.equals(entry.getValue()) && MixAll.MASTER_ID == entry.getKey()) { - isBrokerLegal = true; brokerName = data.getBrokerName(); break; } } - if (isBrokerLegal) { + if (brokerName != null) { break; } } - if (isBrokerLegal && brokerName != null) { + if (brokerName != null) { List queueDataList = topicRouteData.getQueueDatas(); assert queueDataList != null && queueDataList.size() > 0; int oldPerm = 0; -- GitLab