From 50e314eb8ada23283dcdbb261766183c90fd435c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=93=E5=8F=8C=20Li=20Xiao=20Shuang?= <644968328@qq.com> Date: Sun, 17 Apr 2022 23:58:38 +0800 Subject: [PATCH] [ISSUE #4123] Explicit type argument can be replaced with <> for RouteInfoManager (#4124) * Explicit type argument can be replaced with <> for RouteInfoManager * Explicit type argument can be replaced with <> for RouteInfoManager --- .../namesrv/routeinfo/RouteInfoManager.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java b/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java index 2069f9674c4..12cc66f572b 100644 --- a/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java +++ b/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java @@ -61,11 +61,11 @@ public class RouteInfoManager { private final HashMap/* Filter Server */> filterServerTable; public RouteInfoManager() { - this.topicQueueTable = new HashMap>(1024); - this.brokerAddrTable = new HashMap(128); - this.clusterAddrTable = new HashMap>(32); - this.brokerLiveTable = new HashMap(256); - this.filterServerTable = new HashMap>(256); + this.topicQueueTable = new HashMap<>(1024); + this.brokerAddrTable = new HashMap<>(128); + this.clusterAddrTable = new HashMap<>(32); + this.brokerLiveTable = new HashMap<>(256); + this.filterServerTable = new HashMap<>(256); } public ClusterInfo getAllClusterInfo() { @@ -120,7 +120,7 @@ public RegisterBrokerResult registerBroker( Set brokerNames = this.clusterAddrTable.get(clusterName); if (null == brokerNames) { - brokerNames = new HashSet(); + brokerNames = new HashSet<>(); this.clusterAddrTable.put(clusterName, brokerNames); } brokerNames.add(brokerName); @@ -130,7 +130,7 @@ public RegisterBrokerResult registerBroker( BrokerData brokerData = this.brokerAddrTable.get(brokerName); if (null == brokerData) { registerFirst = true; - brokerData = new BrokerData(clusterName, brokerName, new HashMap()); + brokerData = new BrokerData(clusterName, brokerName, new HashMap<>()); this.brokerAddrTable.put(brokerName, brokerData); } Map brokerAddrsMap = brokerData.getBrokerAddrs(); @@ -383,11 +383,11 @@ public TopicRouteData pickupTopicRouteData(final String topic) { TopicRouteData topicRouteData = new TopicRouteData(); boolean foundQueueData = false; boolean foundBrokerData = false; - Set brokerNameSet = new HashSet(); - List brokerDataList = new LinkedList(); + Set brokerNameSet = new HashSet<>(); + List brokerDataList = new LinkedList<>(); topicRouteData.setBrokerDatas(brokerDataList); - HashMap> filterServerMap = new HashMap>(); + HashMap> filterServerMap = new HashMap<>(); topicRouteData.setFilterServerTable(filterServerMap); try {