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

    https://github.com/apache/brooklyn-server/pull/106#discussion_r59541706
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScanner.java
 ---
    @@ -155,9 +181,42 @@ public void removedBundle(Bundle bundle, BundleEvent 
bundleEvent, Iterable<? ext
                     LOG.debug("No BOM found in {} {} {}", bundleIds(bundle));
                 }
     
    +            if (!passesWhiteAndBlacklists(bundle)) {
    +                removeAnyApplications(catalogItems);
    +            }
    +
                 return catalogItems;
             }
     
    +        private void removeAnyApplications(Iterable<? extends 
CatalogItem<?, ?>> catalogItems) {
    +
    +            final Iterator<? extends CatalogItem<?, ?>> cit = 
catalogItems.iterator();
    +            while (cit.hasNext()) {
    +                final CatalogItem<?, ?> item = cit.next();
    +                if (TEMPLATE.equals(item.getCatalogItemType())) {
    +                    removeFromCatalog(item);
    +                    cit.remove();
    --- End diff --
    
    (minor) No need for an iterator & removing the items from `catalogItems`. 
`removeFromCatalog` does all that's needed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to