activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "clebert suconic (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (ARTEMIS-335) Dead code in MQTTPublishManager.generateMqttId?
Date Thu, 31 Aug 2017 19:12:30 GMT

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

clebert suconic closed ARTEMIS-335.
-----------------------------------

> Dead code in MQTTPublishManager.generateMqttId?
> -----------------------------------------------
>
>                 Key: ARTEMIS-335
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-335
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Ville Skyttä
>            Assignee: Martyn Taylor
>            Priority: Minor
>             Fix For: 1.4.0
>
>
> MQTTPublishManager.generateMqttId:
> {code:java}
>       if (qos == 1) {
>          return session.getSessionState().generateId();
>       }
>       else {
>         Integer mqttid = session.getSessionState().generateId();
>          if (mqttid == null) {
>             mqttid = (int) session.getServer().getStorageManager().generateID();
>          }
>          return mqttid;
>       }
>  {code}
> mqttid can never be null, because MQTTSessionState.generateId() returns an int, not Integer.
Therefore the whole above code block could be replaced by {{return session.getSessionState().generateId()}}.
Not sure if that's the intention or not, therefore reporting here instead of filing a PR.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message