You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2014/09/01 18:55:35 UTC
[04/11] git commit: Fix listAttributesWhenReady
Fix listAttributesWhenReady
- was not using readinessPredicate, so infinite loop
- also removes compiler warning in attributeWhenReady
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/afb2b6f2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/afb2b6f2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/afb2b6f2
Branch: refs/heads/master
Commit: afb2b6f2c6bff160c14cdc449d18a21d4260621e
Parents: bfc567d
Author: Aled Sage <al...@gmail.com>
Authored: Mon Aug 18 08:29:28 2014 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Mon Aug 18 08:30:34 2014 +0100
----------------------------------------------------------------------
.../java/brooklyn/event/basic/DependentConfiguration.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/afb2b6f2/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java b/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java
index 042758a..e549bd5 100644
--- a/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java
+++ b/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java
@@ -99,8 +99,8 @@ public class DependentConfiguration {
return attributeWhenReady(source, sensor, GroovyJavaMethods.truthPredicate());
}
- public static <T> Task<T> attributeWhenReady(Entity source, AttributeSensor<T> sensor, Closure ready) {
- Predicate<T> readyPredicate = (ready != null) ? GroovyJavaMethods.predicateFromClosure(ready) : GroovyJavaMethods.truthPredicate();
+ public static <T> Task<T> attributeWhenReady(Entity source, AttributeSensor<T> sensor, Closure<Boolean> ready) {
+ Predicate<Object> readyPredicate = (ready != null) ? GroovyJavaMethods.<Object>predicateFromClosure(ready) : GroovyJavaMethods.truthPredicate();
return attributeWhenReady(source, sensor, readyPredicate);
}
@@ -346,9 +346,9 @@ public class DependentConfiguration {
return listAttributesWhenReady(sensor, entities, GroovyJavaMethods.truthPredicate());
}
- public static <T> Task<List<T>> listAttributesWhenReady(AttributeSensor<T> sensor, Iterable<Entity> entities, Closure readiness) {
- Predicate<T> readinessPredicate = (readiness != null) ? GroovyJavaMethods.predicateFromClosure(readiness) : GroovyJavaMethods.truthPredicate();
- return listAttributesWhenReady(sensor, entities, readiness);
+ public static <T> Task<List<T>> listAttributesWhenReady(AttributeSensor<T> sensor, Iterable<Entity> entities, Closure<Boolean> readiness) {
+ Predicate<Object> readinessPredicate = (readiness != null) ? GroovyJavaMethods.<Object>predicateFromClosure(readiness) : GroovyJavaMethods.truthPredicate();
+ return listAttributesWhenReady(sensor, entities, readinessPredicate);
}
/** returns a task for parallel execution returning a list of values of the given sensor list on the given entity,