brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [1/3] brooklyn-server git commit: app defaultName usage: Fix ApplicationsYamlTest
Date Tue, 21 Jun 2016 10:19:57 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master ee3ca1e71 -> c90cb2dec


app defaultName usage: Fix ApplicationsYamlTest

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

Branch: refs/heads/master
Commit: f8a03a88ccb6a62b20cbaaf8ff6e36bd6f99d7f4
Parents: dfb5c3c
Author: Aled Sage <aled.sage@gmail.com>
Authored: Fri Jun 17 16:52:42 2016 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Fri Jun 17 16:52:53 2016 +0100

----------------------------------------------------------------------
 .../apache/brooklyn/entity/stock/BasicApplicationImpl.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/f8a03a88/core/src/main/java/org/apache/brooklyn/entity/stock/BasicApplicationImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/entity/stock/BasicApplicationImpl.java
b/core/src/main/java/org/apache/brooklyn/entity/stock/BasicApplicationImpl.java
index 3c7e097..631e96f 100644
--- a/core/src/main/java/org/apache/brooklyn/entity/stock/BasicApplicationImpl.java
+++ b/core/src/main/java/org/apache/brooklyn/entity/stock/BasicApplicationImpl.java
@@ -19,13 +19,19 @@
 package org.apache.brooklyn.entity.stock;
 
 import org.apache.brooklyn.core.entity.AbstractApplication;
+import org.apache.brooklyn.util.text.Strings;
 
 public class BasicApplicationImpl extends AbstractApplication implements BasicApplication
{
 
     @Override
     public void init() {
+        // Set the default name *before* calling super.init(), and only do so if we don't
have an 
+        // explicit default. This is a belt-and-braces fix: before we overwrote the defaultDisplayName
+        // that was inferred from the catalog item name.
+        if (Strings.isBlank(getConfig(DEFAULT_DISPLAY_NAME))) {
+            setDefaultDisplayName("Application ("+getId()+")");
+        }
         super.init();
-        setDefaultDisplayName("Application ("+getId()+")");
     }
     
 }


Mime
View raw message