You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tubemq.apache.org by "viviel (Jira)" <ji...@apache.org> on 2020/05/22 09:02:00 UTC

[jira] [Closed] (TUBEMQ-102) Fix question [TUBEMQ-101] [Optimize code]

     [ https://issues.apache.org/jira/browse/TUBEMQ-102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

viviel closed TUBEMQ-102.
-------------------------

> Fix question [TUBEMQ-101] [Optimize code]
> -----------------------------------------
>
>                 Key: TUBEMQ-102
>                 URL: https://issues.apache.org/jira/browse/TUBEMQ-102
>             Project: Apache TubeMQ
>          Issue Type: Bug
>            Reporter: viviel
>            Assignee: viviel
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.5.0
>
>
> Because the core module uses jdk1.7, this code cannot use 'putIfAbsent'
> {code:java}
> addrMap4Failover.putIfAbsent(tmpNodeAddrInfo.getHostPortStr(), tmpNodeAddrInfo);
> {code}
> We should use the original
> {code:java}
> if (addrMap4Failover.get(tmpNodeAddrInfo.getHostPortStr()) == null) {
>     addrMap4Failover.put(tmpNodeAddrInfo.getHostPortStr(), tmpNodeAddrInfo);
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)