-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #22] Improving codeCov for mqtt.common #89
Conversation
if (resource != null && resource.contains("%")) { | ||
int firstIndex = resource.indexOf("%"); | ||
if (resource != null && resource.contains(NAMESPACE_SPLITER)) { | ||
int firstIndex = resource.indexOf(NAMESPACE_SPLITER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using defined constant
} else { | ||
return null; | ||
} | ||
return splitNamespaceStr(topic); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encapsulate duplicate code block
if (invoke.minRt.get() > rt) { | ||
invoke.minRt.set(rt); | ||
} | ||
addInvoke(key, 1, rt, success); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reusing 'addInvoke' method
@@ -31,7 +31,7 @@ public class TopicUtils { | |||
* @return | |||
*/ | |||
public static String normalizeTopic(String topic) { | |||
if (topic == null) { | |||
if (topic == null || topic.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug of 'empty str'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be use StringUtils.isBlank(topic) will be better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be use StringUtils.isBlank(topic) will be better
done
return null; | ||
} | ||
if (mqttTopic.getSecondTopic() == null || mqttTopic.getFirstTopic() == null) { | ||
if (!isP2P(mqttTopic.getSecondTopic())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reserve the order of 'null judgment' and 'p2p judgment'
Wonder under what conditions the codecov-commenter will be triggered? @tianliuliu , thanks :-) |
it can be triggered always, sometimes it dosen't work, maybe the bug itself. |
codeCov for mqtt.common to improving #22