brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [3/4] brooklyn-server git commit: fix code review comments
Date Thu, 18 Jan 2018 09:06:30 GMT
fix code review 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/50518876
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/50518876
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/50518876

Branch: refs/heads/master
Commit: 50518876ea6e8ebdb1408b899587b50c7ad6defb
Parents: 1f734a8
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Wed Jan 17 17:05:21 2018 +0000
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Wed Jan 17 17:05:21 2018 +0000

----------------------------------------------------------------------
 .../java/org/apache/brooklyn/api/catalog/BrooklynCatalog.java   | 2 +-
 .../brooklyn/core/catalog/internal/BasicBrooklynCatalog.java    | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/50518876/api/src/main/java/org/apache/brooklyn/api/catalog/BrooklynCatalog.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/brooklyn/api/catalog/BrooklynCatalog.java b/api/src/main/java/org/apache/brooklyn/api/catalog/BrooklynCatalog.java
index c3aff13..7d66cb6 100644
--- a/api/src/main/java/org/apache/brooklyn/api/catalog/BrooklynCatalog.java
+++ b/api/src/main/java/org/apache/brooklyn/api/catalog/BrooklynCatalog.java
@@ -63,7 +63,7 @@ public interface BrooklynCatalog {
     @Deprecated
     void deleteCatalogItem(String symbolicName, String version);
 
-    /** @return Deletes the item with the given {@link CatalogItem#getSymbolicName()
+    /** Deletes the item with the given {@link CatalogItem#getSymbolicName()
      * symbolicName} and version
      * @throws NoSuchElementException if not found 
      * @deprecated since introduced in 1.0.0, only used for transitioning */

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/50518876/core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java
index 4f399f2..ab7300f 100644
--- a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java
+++ b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java
@@ -494,7 +494,8 @@ public class BasicBrooklynCatalog implements BrooklynCatalog {
         while (item instanceof CatalogItemDo) item = ((CatalogItemDo<T,SpecT>)item).itemDto;
         if (item==null) return null;
         if (item instanceof CatalogItemDtoAbstract) return (CatalogItemDtoAbstract<T,SpecT>)
item;
-        CatalogItem<?, ?> item2 = getCatalogItem(item.getSymbolicName(), item.getVersion());
+        CatalogItem<?, ?> item2 = getCatalogItemLegacy(item.getSymbolicName(), item.getVersion());
+        if (item2 instanceof CatalogItemDtoAbstract) return (CatalogItemDtoAbstract<T,SpecT>)
item2;
         throw new IllegalStateException("Cannot unwrap catalog item '"+item+"' (type "+item.getClass()+")
to restore DTO");
     }
     
@@ -1460,7 +1461,7 @@ public class BasicBrooklynCatalog implements BrooklynCatalog {
     @Deprecated
     @Override
     public List<? extends CatalogItem<?,?>> addItems(String yaml, boolean forceUpdate)
{
-        return addItems(yaml, true, false);
+        return addItems(yaml, true, forceUpdate);
     }
     
     @Override


Mime
View raw message