Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/506#discussion_r24321734
--- Diff: core/src/main/java/brooklyn/entity/group/DynamicClusterImpl.java
---
@@ -130,12 +130,14 @@ public ZoneFailureDetector apply(final String input) {
private static final Function<Collection<Entity>, Entity>
defaultRemovalStrategy = new Function<Collection<Entity>, Entity>() {
@Override public Entity apply(Collection<Entity> contenders) {
- // choose newest entity that is stoppable
+ // choose newest entity that is stoppable, or if none are
stoppable take the newest non-stoppable
long newestTime = 0;
Entity newest = null;
for (Entity contender : contenders) {
- if (contender instanceof Startable &&
contender.getCreationTime() > newestTime) {
+ boolean newer = contender.getCreationTime() > newestTime;
--- End diff --
Is there a unit test for this, using the `DynamicCluster` with
non-startable entities?
---
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.
---