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

    https://github.com/apache/incubator-brooklyn/pull/617#discussion_r30692077
  
    --- Diff: 
core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java ---
    @@ -597,7 +612,22 @@ private void collectCatalogItems(String sourceYaml, 
Map<?,?> itemMetadata, List<
             Collection<CatalogBundle> libraryBundles = 
CatalogItemDtoAbstract.parseLibraries(librariesCombined);
     
             // TODO as this may take a while if downloading, the REST call 
should be async
    +        // (this load is required for the scan below and I think also for 
yaml resolution)
             CatalogUtils.installLibraries(mgmt, libraryBundlesNew);
    +
    +        Boolean scanJavaAnnotations = getFirstAs(itemMetadata, 
Boolean.class, "scanJavaAnnotations", "scan_java_annotations").orNull();
    +        if (scanJavaAnnotations==null || !scanJavaAnnotations) {
    +            // don't scan
    +        } else {
    +            // scan for annotations: if libraries here, scan them; if 
inherited libraries error; else scan classpath
    +            if (!libraryBundlesNew.isEmpty()) {
    +                result.addAll(scanAnnotationsFromBundles(mgmt, 
libraryBundlesNew));
    +            } else if (libraryBundles.isEmpty()) {
    +                result.addAll(scanAnnotationsFromLocal(mgmt));
    +            } else {
    +                throw new IllegalStateException("Cannot scan catalog node 
no local bundles, and with inherited bundles we will not scan the classpath");
    +            }
    --- End diff --
    
    Might be better to have two scan keywords - one for local bundles, the 
other for brooklyn classpath. This will avoid the context dependency, make 
intent explicit, easier for users to understand.


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