Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/856#discussion_r150102381
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBundleLoader.java
 ---
    @@ -103,8 +103,8 @@ private TemporaryInternalScanResult 
scanForCatalogInternal(Bundle bundle, boolea
                     
this.managementContext.getCatalog().addTypesFromBundleBom(bomText, mb, force, 
result.mapOfNewToReplaced);
                     if (validate) {
                         Set<RegisteredType> matches = 
MutableSet.copyOf(this.managementContext.getTypeRegistry().getMatching(RegisteredTypePredicates.containingBundle(mb.getVersionedName())));
    -                    if 
(!(matches.containsAll(result.mapOfNewToReplaced.keySet()) && 
result.mapOfNewToReplaced.keySet().containsAll(matches))) {
    -                        // sanity check
    +                    if (matches.size()!=result.mapOfNewToReplaced.size()) {
    --- End diff --
    
    @ahgittin can you explain more the purpose/context of this check, and why 
you only want to log.warn if the sizes are different?
    
    I recall seeing such warnings in the log when I suspect we shouldn't have, 
so think you're right to guard against it better.
    
    For @tbouron's suggestion of checking the symbolicName:version, that makes 
sense - or does this get called a lot or with really big things so performance 
matters?


---

Reply via email to