Github user robertgmoss commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/218#discussion_r69440113
--- Diff:
camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java
---
@@ -100,30 +103,36 @@ protected EntityInternal getEntity() {
@Override
public Entity call() throws Exception {
Iterable<Entity> entitiesToSearch = null;
+ EntityInternal entity = getEntity();
+ Predicate<Entity> notSelfPredicate =
Predicates.not(Predicates.<Entity>equalTo(entity));
+
switch (scope) {
case THIS:
- return getEntity();
+ return entity;
case PARENT:
- return getEntity().getParent();
+ return entity.getParent();
case GLOBAL:
- entitiesToSearch =
((EntityManagerInternal)getEntity().getManagementContext().getEntityManager())
+ entitiesToSearch =
((EntityManagerInternal)entity.getManagementContext().getEntityManager())
.getAllEntitiesInApplication(
entity().getApplication() );
break;
case ROOT:
- return getEntity().getApplication();
+ return entity.getApplication();
case SCOPE_ROOT:
- return Entities.catalogItemScopeRoot(getEntity());
+ return Entities.catalogItemScopeRoot(entity);
case DESCENDANT:
- entitiesToSearch = Entities.descendants(getEntity());
+ entitiesToSearch =
Entities.descendantsWithoutSelf(entity);
+ entitiesToSearch = Iterables.filter(entitiesToSearch,
notSelfPredicate);
--- End diff --
is this required? previous line suggests self will not be included
---
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.
---