brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/2] incubator-brooklyn git commit: Rebind NPE fixes
Date Thu, 17 Dec 2015 10:58:33 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 9dc1cb4a4 -> 3812be067


Rebind NPE fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3db2ca4b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3db2ca4b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3db2ca4b

Branch: refs/heads/master
Commit: 3db2ca4b4ce8ca8c013db145a08c619f8dbbe12c
Parents: e6235d9
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Wed Dec 16 22:03:09 2015 +0200
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Thu Dec 17 09:23:48 2015 +0200

----------------------------------------------------------------------
 .../brooklyn/api/internal/AbstractBrooklynObjectSpec.java     | 7 ++++++-
 .../java/org/apache/brooklyn/core/config/BasicConfigKey.java  | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3db2ca4b/api/src/main/java/org/apache/brooklyn/api/internal/AbstractBrooklynObjectSpec.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/brooklyn/api/internal/AbstractBrooklynObjectSpec.java
b/api/src/main/java/org/apache/brooklyn/api/internal/AbstractBrooklynObjectSpec.java
index aa3a198..ab046d5 100644
--- a/api/src/main/java/org/apache/brooklyn/api/internal/AbstractBrooklynObjectSpec.java
+++ b/api/src/main/java/org/apache/brooklyn/api/internal/AbstractBrooklynObjectSpec.java
@@ -136,7 +136,12 @@ public abstract class AbstractBrooklynObjectSpec<T,SpecT extends AbstractBrookly
 
     /** A list of configuration options that the entity supports. */
     public final List<SpecParameter<?>> getParameters() {
-        return ImmutableList.copyOf(parameters);
+        //Could be null after rebind
+        if (parameters != null) {
+            return ImmutableList.copyOf(parameters);
+        } else {
+            return ImmutableList.of();
+        }
     }
 
     // TODO Duplicates method in BasicEntityTypeRegistry and InternalEntityFactory.isNewStyleEntity

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3db2ca4b/core/src/main/java/org/apache/brooklyn/core/config/BasicConfigKey.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/config/BasicConfigKey.java b/core/src/main/java/org/apache/brooklyn/core/config/BasicConfigKey.java
index fe5e064..2e59185 100644
--- a/core/src/main/java/org/apache/brooklyn/core/config/BasicConfigKey.java
+++ b/core/src/main/java/org/apache/brooklyn/core/config/BasicConfigKey.java
@@ -217,7 +217,12 @@ public class BasicConfigKey<T> implements ConfigKeySelfExtracting<T>,
Serializab
     /** @see ConfigKey#getConstraint() */
     @Override @Nonnull
     public Predicate<? super T> getConstraint() {
-        return constraint;
+        // Could be null after rebinding
+        if (constraint != null) {
+            return constraint;
+        } else {
+            return Predicates.alwaysTrue();
+        }
     }
 
     /** @see ConfigKey#isValueValid(T) */


Mime
View raw message