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 logging for double plan in bundle error
Date Thu, 20 Jul 2017 12:10:50 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 818016165 -> ef5e60f69


more logging for double plan in bundle error


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

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

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


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ef5e60f6/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 7097270..bd2b056 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
@@ -368,8 +368,12 @@ public class BasicBrooklynTypeRegistry implements BrooklynTypeRegistry
{
         if (Objects.equals(oldType.getContainingBundle(), type.getContainingBundle())) {
             // if named bundles equal then contents must be the same (due to bundle checksum);
bail out early
             if (!oldType.getPlan().equals(type.getPlan())) {
-                // shouldn't come here, but check anyway (or maybe if item added twice in
the same catalog?)
-                throw new IllegalStateException("Cannot add "+type+" to catalog; different
plan in "+oldType+" from same bundle is already present");
+                String msg = "Cannot add "+type+" to catalog; different plan in "+oldType+"
from same bundle "+
+                    type.getContainingBundle()+" is already present";
+                log.debug(msg+"\n"+
+                    "Plan being added is:\n"+type.getPlan()+"\n"+
+                    "Plan already present is:\n"+oldType.getPlan() );
+                throw new IllegalStateException(msg);
             }
             if (oldType.getKind()!=RegisteredTypeKind.UNRESOLVED && type.getKind()!=RegisteredTypeKind.UNRESOLVED
&&
                     !Objects.equals(oldType.getKind(), type.getKind())) {
@@ -384,8 +388,8 @@ public class BasicBrooklynTypeRegistry implements BrooklynTypeRegistry
{
             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() );
+                "Plan being added from "+type.getContainingBundle()+" is:\n"+type.getPlan()+"\n"+
+                "Plan already present from "+oldType.getContainingBundle()+" is:\n"+oldType.getPlan()
);
             throw new IllegalStateException(msg);
         }
         if (oldType.getKind()!=RegisteredTypeKind.UNRESOLVED && type.getKind()!=RegisteredTypeKind.UNRESOLVED
&&


Mime
View raw message