brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [41/50] brooklyn-server git commit: minor tidies to core (better error catching, and generics)
Date Mon, 01 Feb 2016 17:49:45 GMT
minor tidies to core (better error catching, and generics)


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/74d2380f
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/74d2380f
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/74d2380f

Branch: refs/heads/0.6.0
Commit: 74d2380fd9fd2a9be13ca8faa15785ab0df9d7a9
Parents: 78d734e
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Thu Nov 14 07:32:46 2013 +0000
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Thu Nov 14 21:21:31 2013 +0000

----------------------------------------------------------------------
 core/src/main/java/brooklyn/entity/basic/EntityDynamicType.java  | 4 ++++
 .../main/java/brooklyn/event/basic/DependentConfiguration.java   | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/74d2380f/core/src/main/java/brooklyn/entity/basic/EntityDynamicType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/EntityDynamicType.java b/core/src/main/java/brooklyn/entity/basic/EntityDynamicType.java
index 69615fd..83e541f 100644
--- a/core/src/main/java/brooklyn/entity/basic/EntityDynamicType.java
+++ b/core/src/main/java/brooklyn/entity/basic/EntityDynamicType.java
@@ -277,6 +277,10 @@ public class EntityDynamicType {
                         if (optionalEntity==null) continue;
                     }
                     Effector<?> eff = (Effector<?>) f.get(optionalEntity);
+                    if (eff==null) {
+                        LOG.warn("Effector "+f+" undefined for "+clazz+" ("+optionalEntity+")");
+                        continue;
+                    }
                     Effector<?> overwritten = result.put(eff.getName(), eff);
                     Field overwrittenFieldSource = fieldSources.put(eff.getName(), f);
                     if (overwritten!=null && !Effectors.sameInstance(overwritten,
eff)) {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/74d2380f/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 f68662c..26fe214 100644
--- a/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java
+++ b/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java
@@ -107,11 +107,11 @@ public class DependentConfiguration {
         return DependentConfiguration.<T,T>attributePostProcessedWhenReady(source,
sensor, GroovyJavaMethods.truthPredicate(), Functions.constant(value));
     }
 
-    public static <T> Task<T> valueWhenAttributeReady(Entity source, AttributeSensor<T>
sensor, Function<? super T,T> valueProvider) {
+    public static <T,V> Task<V> valueWhenAttributeReady(Entity source, AttributeSensor<T>
sensor, Function<? super T,V> valueProvider) {
         return attributePostProcessedWhenReady(source, sensor, GroovyJavaMethods.truthPredicate(),
valueProvider);
     }
     
-    public static <T> Task<T> valueWhenAttributeReady(Entity source, AttributeSensor<T>
sensor, Closure<T> valueProvider) {
+    public static <T,V> Task<V> valueWhenAttributeReady(Entity source, AttributeSensor<T>
sensor, Closure<V> valueProvider) {
         return attributePostProcessedWhenReady(source, sensor, GroovyJavaMethods.truthPredicate(),
valueProvider);
     }
     


Mime
View raw message