activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-335) Dead code in MQTTPublishManager.generateMqttId?
Date Thu, 21 Jul 2016 19:51:20 GMT

    [ https://issues.apache.org/jira/browse/ARTEMIS-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15388305#comment-15388305
] 

ASF subversion and git services commented on ARTEMIS-335:
---------------------------------------------------------

Commit fe0cb648d60ee6bab98f5f86225bbe18ca7c42de in activemq-artemis's branch refs/heads/master
from [~martyntaylor]
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=fe0cb64 ]

ARTEMIS-335 Remove dead code from MQTTPublishManager


> 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
>
> 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.3.4#6332)

Mime
View raw message