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 2016/07/07 09:38:19 UTC

[1/2] brooklyn-server git commit: Fix Entities.UNCHANGED marker, for rebind

Repository: brooklyn-server
Updated Branches:
  refs/heads/master 257926534 -> 20c6b1e00


Fix Entities.UNCHANGED marker, for rebind

Previously, after rebind then enrichers using this would have their
own copy of their object (due to xstream deserialisation). Instead,
use an enum.

This does not fix the problem for existing persisted state of enrichers
that have their own object!

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

Branch: refs/heads/master
Commit: 1455bbefabf610132c60c2f89a1c3e78a3d45f8e
Parents: 1f2e2a1
Author: Aled Sage <al...@gmail.com>
Authored: Wed Jul 6 13:16:29 2016 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Wed Jul 6 13:16:29 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/brooklyn/core/entity/Entities.java   | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1455bbef/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java b/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java
index 1909845..2821652 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/Entities.java
@@ -144,19 +144,26 @@ public class Entities {
             "access.cert",
             "access.key");
 
+    // Don't use `new Object()` - deserialization creates a different object from the constant.
+    // Instead, use this enum.
+    private enum ValueMarkers {
+        UNCHANGED,
+        REMOVE;
+    }
+    
     /**
      * Special object used by some setting methods to indicate that a value should be ignored.
      * <p>
      * See specific usages of this field to confirm where.
      */
-    public static final Object UNCHANGED = new Object();
+    public static final Object UNCHANGED = ValueMarkers.UNCHANGED;
 
     /**
      * Special object used by some setting methods to indicate that a value should be removed.
      * <p>
      * See specific usages of this field to confirm where.
      */
-    public static final Object REMOVE = new Object();
+    public static final Object REMOVE = ValueMarkers.REMOVE;
 
     /**
      * Invokes an {@link Effector} on multiple entities, with the named arguments from the parameters {@link Map}


[2/2] brooklyn-server git commit: This closes #234

Posted by he...@apache.org.
This closes #234


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

Branch: refs/heads/master
Commit: 20c6b1e00036e11d8a2ff45e41e25c39b9022f9f
Parents: 2579265 1455bbe
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Thu Jul 7 10:38:13 2016 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Thu Jul 7 10:38:13 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/brooklyn/core/entity/Entities.java   | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------