brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [2/3] brooklyn-server git commit: address PR comments
Date Sat, 18 Feb 2017 01:00:12 GMT
address PR comments


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/870a4f85
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/870a4f85
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/870a4f85

Branch: refs/heads/master
Commit: 870a4f853b79520c3019b8adb7279c005a4fc27a
Parents: 2c2f3fc
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Sat Feb 18 00:59:37 2017 +0000
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Sat Feb 18 00:59:37 2017 +0000

----------------------------------------------------------------------
 .../core/mgmt/internal/LocalSubscriptionManager.java     | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/870a4f85/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalSubscriptionManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalSubscriptionManager.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalSubscriptionManager.java
index 7039ee2..2349c73 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalSubscriptionManager.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalSubscriptionManager.java
@@ -49,6 +49,7 @@ import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.core.task.BasicExecutionManager;
 import org.apache.brooklyn.util.core.task.SingleThreadedScheduler;
 import org.apache.brooklyn.util.text.Identifiers;
+import org.apache.brooklyn.util.text.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -233,15 +234,17 @@ public class LocalSubscriptionManager extends AbstractSubscriptionManager
{
         
         StringBuilder name = new StringBuilder("sensor ");
         StringBuilder description = new StringBuilder("Sensor ");
-        String sensorName = s.sensor==null ? null : s.sensor.getName();
+        String sensorName = s.sensor==null ? "<null-sensor>" : s.sensor.getName();
         String sourceName = event.getSource()==null ? null : event.getSource().getId();
-        name.append(sourceName);
-        name.append(":");
+        if (Strings.isNonBlank(sourceName)) {
+            name.append(sourceName);
+            name.append(":");
+        }
         name.append(sensorName);
         
         description.append(sensorName);
         description.append(" on ");
-        description.append(sourceName);
+        description.append(sourceName==null ? "<null-source>" : sourceName);
         description.append(" publishing to ");
         description.append(s.subscriber instanceof Entity ? ((Entity)s.subscriber).getId()
: s.subscriber);
         


Mime
View raw message