brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject brooklyn-server git commit: more debugging when plan is the same
Date Thu, 20 Jul 2017 09:17:35 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master c02b3e355 -> 818016165


more debugging when plan is the same


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

Branch: refs/heads/master
Commit: 8180161656d2fabd63527146a5caae47fc0722ff
Parents: c02b3e3
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Thu Jul 20 10:17:19 2017 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Thu Jul 20 10:17:19 2017 +0100

----------------------------------------------------------------------
 .../core/typereg/BasicBrooklynTypeRegistry.java         | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/81801616/core/src/main/java/org/apache/brooklyn/core/typereg/BasicBrooklynTypeRegistry.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/typereg/BasicBrooklynTypeRegistry.java
b/core/src/main/java/org/apache/brooklyn/core/typereg/BasicBrooklynTypeRegistry.java
index f1a3e66..7097270 100644
--- a/core/src/main/java/org/apache/brooklyn/core/typereg/BasicBrooklynTypeRegistry.java
+++ b/core/src/main/java/org/apache/brooklyn/core/typereg/BasicBrooklynTypeRegistry.java
@@ -19,7 +19,6 @@
 package org.apache.brooklyn.core.typereg;
 
 import java.util.Map;
-import java.util.NoSuchElementException;
 import java.util.Objects;
 import java.util.Set;
 
@@ -29,7 +28,6 @@ import org.apache.brooklyn.api.catalog.BrooklynCatalog;
 import org.apache.brooklyn.api.catalog.CatalogItem;
 import org.apache.brooklyn.api.catalog.CatalogItem.CatalogItemType;
 import org.apache.brooklyn.api.internal.AbstractBrooklynObjectSpec;
-import org.apache.brooklyn.api.location.Location;
 import org.apache.brooklyn.api.mgmt.ManagementContext;
 import org.apache.brooklyn.api.typereg.BrooklynTypeRegistry;
 import org.apache.brooklyn.api.typereg.RegisteredType;
@@ -37,9 +35,7 @@ import org.apache.brooklyn.api.typereg.RegisteredType.TypeImplementationPlan;
 import org.apache.brooklyn.api.typereg.RegisteredTypeLoadingContext;
 import org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog;
 import org.apache.brooklyn.core.catalog.internal.CatalogItemBuilder;
-import org.apache.brooklyn.core.catalog.internal.CatalogItemDtoAbstract;
 import org.apache.brooklyn.core.catalog.internal.CatalogUtils;
-import org.apache.brooklyn.core.location.BasicLocationRegistry;
 import org.apache.brooklyn.core.mgmt.ha.OsgiManager;
 import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
 import org.apache.brooklyn.test.Asserts;
@@ -385,8 +381,12 @@ public class BasicBrooklynTypeRegistry implements BrooklynTypeRegistry
{
         // different bundles, either anonymous or same item in two named bundles
         if (!oldType.getPlan().equals(type.getPlan())) {
             // if plan is different, fail
-            throw new IllegalStateException("Cannot add "+type+" in "+type.getContainingBundle()+"
to catalog; different plan in "+oldType+" from bundle "+
-                oldType.getContainingBundle()+" is already present");
+            String msg = "Cannot add "+type+" in "+type.getContainingBundle()+" to catalog;
different plan in "+oldType+" from bundle "+
+                oldType.getContainingBundle()+" is already present (throwing)";
+            log.debug(msg+"\n"+
+                "Plan from "+type.getContainingBundle()+" is:\n"+type.getPlan()+"\n"+
+                "Plan from "+oldType.getContainingBundle()+" is:\n"+oldType.getPlan() );
+            throw new IllegalStateException(msg);
         }
         if (oldType.getKind()!=RegisteredTypeKind.UNRESOLVED && type.getKind()!=RegisteredTypeKind.UNRESOLVED
&&
                 !Objects.equals(oldType.getKind(), type.getKind())) {


Mime
View raw message