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

    https://github.com/apache/brooklyn-server/pull/608#discussion_r108101905
  
    --- Diff: 
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
 ---
    @@ -245,13 +246,21 @@ public Response createFromArchive(byte[] zipInput) {
                 
                 if 
(!BrooklynFeatureEnablement.isEnabled(BrooklynFeatureEnablement.FEATURE_LOAD_BUNDLE_CATALOG_BOM))
 {
                     // if the above feature is not enabled, let's do it 
manually (as a contract of this method)
    -                new CatalogBomScanner().new CatalogPopulator(
    -                        ((LocalManagementContext) 
mgmt()).getOsgiManager().get().getFramework().getBundleContext(),
    -                        mgmt()).addingBundle(bundle, null);
    +                try {
    +                    new CatalogBundleLoader(new CatalogBomScanner(), 
mgmt()).scanForCatalog(bundle);
    --- End diff --
    
    @geomacy Yup, the dependency on `CatalogBomScanner` is ugly. I knew it had 
to be changed but wanted this to be merged as soon as possible so I just moved 
the code around rather than really refactor.
    
    Re the whitelist injection for the REST API: I was wondering what if we add 
the `CatalogBomScanner` to the new `ScratchPad` area? It's supposed to be a 
singleton isn't it? We can then get back the correctly setup predicate from it.
    
    WDYT?


---
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