tianliuliu commented on code in PR #45:
URL: https://github.com/apache/rocketmq-mqtt/pull/45#discussion_r839474262
##########
mqtt-cs/src/main/java/org/apache/rocketmq/mqtt/cs/channel/ChannelInfo.java:
##########
@@ -93,11 +93,7 @@ public static boolean checkExtDataChange(Channel channel) {
if (!getInfo(channel).containsKey(CHANNEL_EXT_CHANGE_KEY)) {
getInfo(channel).put(CHANNEL_EXT_CHANGE_KEY, false);
}
- Object obj = getInfo(channel).get(CHANNEL_EXT_CHANGE_KEY);
- if (obj == null) {
- return false;
- }
- return (boolean)obj;
+ return (boolean) getInfo(channel).get(CHANNEL_EXT_CHANGE_KEY);
Review Comment:
same as the above comment
##########
mqtt-cs/src/main/java/org/apache/rocketmq/mqtt/cs/channel/ChannelInfo.java:
##########
@@ -114,11 +110,7 @@ public static Boolean getCleanSessionFlag(Channel channel)
{
if (!getInfo(channel).containsKey(CHANNEL_CLEAN_SESSION_KEY)) {
getInfo(channel).put(CHANNEL_CLEAN_SESSION_KEY, true);
}
- Object obj = getInfo(channel).get(CHANNEL_CLEAN_SESSION_KEY);
- if (obj == null) {
- return true;
- }
- return (Boolean)obj;
+ return (Boolean) getInfo(channel).get(CHANNEL_CLEAN_SESSION_KEY);
Review Comment:
in high concurrency scenarios, when the clear(Channel channel) method is
called, NPE will be triggered here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]