WillemJiang commented on a change in pull request #562: [SCB-358] fix bug for
monitor output id that register only name without any tags
URL:
https://github.com/apache/incubator-servicecomb-java-chassis/pull/562#discussion_r171290678
##########
File path:
foundations/foundation-metrics/src/main/java/org/apache/servicecomb/foundation/metrics/publish/Metric.java
##########
@@ -71,11 +95,28 @@ public boolean containsTag(String tagKey, String tagValue)
{
}
public boolean containsTag(String... tags) {
- for (int i = 0; i < tags.length; i += 2) {
- if (!containsTag(tags[i], tags[i + 1])) {
- return false;
+ if (tags.length >= 2 && tags.length % 2 == 0) {
+ for (int i = 0; i < tags.length; i += 2) {
+ if (!containsTag(tags[i], tags[i + 1])) {
+ return false;
+ }
}
+ return true;
}
- return true;
+ throw new ServiceCombException("bad tags count");
Review comment:
We need to know more detail about this exception.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services