Github user neykov commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/617#discussion_r30712561
--- 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 --
> that collection won't be empty if either is supplied, and so it then
won't scanAnnotationsFromLocal
It will go through `scanAnnotationsFromBundles`, but in
`CatalogClasspathDo.load` the list will be filtered out of the non-url bundles,
making it go through [this code
branch](https://github.com/apache/incubator-brooklyn/blob/09a64755e2c16c25f076af6a32f93ee0ff8c2599/core/src/main/java/brooklyn/catalog/internal/CatalogClasspathDo.java#L137)
I see you've already changed the code, just wanted to clear up what I meant.
---
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.
---