Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1673#discussion_r79302819
  
    --- Diff: server/src/com/cloud/server/StatsCollector.java ---
    @@ -285,9 +286,15 @@ private void init(Map<String, String> configs) {
                         s_logger.info(scheme + " is not a valid protocol for 
external statistics. No statistics will be send.");
                     }
     
    -                externalStatsHost = uri.getHost();
    +                if (!StringUtils.isEmpty(uri.getHost())) {
    +                    externalStatsHost = uri.getHost();
    +                }
    +
                     externalStatsPort = uri.getPort();
    -                externalStatsPrefix = uri.getPath().substring(1);
    +
    +                if (!StringUtils.isEmpty(uri.getPath())) {
    +                    externalStatsPrefix = uri.getPath().substring(1);
    +                }
     
                     /* Append a dot (.) to the prefix if it is set */
                     if (externalStatsPrefix != null && 
!externalStatsPrefix.equals("")) {
    --- End diff --
    
    I realize it's not in the scope of this PR, but would you consider changing 
this `if` block to use `StringUtils.isEmpty`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to