brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: CLI commands for manipulating cat...
Date Wed, 20 May 2015 12:52:52 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/617#discussion_r30697461
  
    --- Diff: core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java ---
    @@ -750,7 +780,37 @@ private String setFromItemIfUnset(String oldValue, Map<?,?>
item, String fieldAt
             return oldValue;
         }
     
    +    private Collection<CatalogItemDtoAbstract<?, ?>> scanAnnotationsFromLocal(ManagementContext
mgmt) {
    +        CatalogDto dto = CatalogDto.newNamedInstance("Local Scanned Catalog", "All annotated
Brooklyn entities detected in the classpath", "scanning-local-classpath");
    +        return scanAnnotationsInternal(mgmt, new CatalogDo(dto));
    +    }
         
    +    private Collection<CatalogItemDtoAbstract<?, ?>> scanAnnotationsFromBundles(ManagementContext
mgmt, Collection<CatalogBundle> libraries) {
    +        String[] urls = null;
    +        CatalogDto dto = CatalogDto.newNamedInstance("Bundles Scanned Catalog", "All
annotated Brooklyn entities detected in the classpath", "scanning-bundles-classpath-"+libraries.hashCode());
    +        urls = new String[libraries.size()];
    +        int i=0;
    +        for (CatalogBundle b: libraries)
    +            urls[i++] = b.getUrl();
    +            
    +        CatalogDo subCatalog = new CatalogDo(dto);
    +        subCatalog.addToClasspath(urls);
    --- End diff --
    
    I see that below you are handling the `null` case, but then if all libraries are name-value
pairs, the code path will go in the "scanning catalog root classpath" case. Better move the
null check here.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message