[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
This commit is contained in:
李晓双 Li Xiao Shuang
2022-04-17 23:58:38 +08:00
committed by GitHub
parent 84f03c34b5
commit 50e314eb8a
@@ -61,11 +61,11 @@ public class RouteInfoManager {
private final HashMap<String/* brokerAddr */, List<String>/* Filter Server */> filterServerTable;
public RouteInfoManager() {
this.topicQueueTable = new HashMap<String, Map<String, QueueData>>(1024);
this.brokerAddrTable = new HashMap<String, BrokerData>(128);
this.clusterAddrTable = new HashMap<String, Set<String>>(32);
this.brokerLiveTable = new HashMap<String, BrokerLiveInfo>(256);
this.filterServerTable = new HashMap<String, List<String>>(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 class RouteInfoManager {
Set<String> brokerNames = this.clusterAddrTable.get(clusterName);
if (null == brokerNames) {
brokerNames = new HashSet<String>();
brokerNames = new HashSet<>();
this.clusterAddrTable.put(clusterName, brokerNames);
}
brokerNames.add(brokerName);
@@ -130,7 +130,7 @@ public class RouteInfoManager {
BrokerData brokerData = this.brokerAddrTable.get(brokerName);
if (null == brokerData) {
registerFirst = true;
brokerData = new BrokerData(clusterName, brokerName, new HashMap<Long, String>());
brokerData = new BrokerData(clusterName, brokerName, new HashMap<>());
this.brokerAddrTable.put(brokerName, brokerData);
}
Map<Long, String> brokerAddrsMap = brokerData.getBrokerAddrs();
@@ -383,11 +383,11 @@ public class RouteInfoManager {
TopicRouteData topicRouteData = new TopicRouteData();
boolean foundQueueData = false;
boolean foundBrokerData = false;
Set<String> brokerNameSet = new HashSet<String>();
List<BrokerData> brokerDataList = new LinkedList<BrokerData>();
Set<String> brokerNameSet = new HashSet<>();
List<BrokerData> brokerDataList = new LinkedList<>();
topicRouteData.setBrokerDatas(brokerDataList);
HashMap<String, List<String>> filterServerMap = new HashMap<String, List<String>>();
HashMap<String, List<String>> filterServerMap = new HashMap<>();
topicRouteData.setFilterServerTable(filterServerMap);
try {