brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [2/3] git commit: avoid NPE in AbstractLocation if creationTimeUtc null
Date Thu, 29 May 2014 23:05:16 GMT
avoid NPE in AbstractLocation if creationTimeUtc null

- happens if you unmanaged and then remanage an entity.
- the old creationTimeUtc will have been deleted from storage so will
  be null, so doing `long l = createTimeUtc.get()` NPEs

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

Branch: refs/heads/master
Commit: b2c549a4aa2bdbf47f37730a1fd0ba12ecc26476
Parents: eacfb26
Author: Aled Sage <aled.sage@gmail.com>
Authored: Thu May 29 23:48:05 2014 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Thu May 29 23:48:05 2014 +0100

----------------------------------------------------------------------
 core/src/main/java/brooklyn/location/basic/AbstractLocation.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b2c549a4/core/src/main/java/brooklyn/location/basic/AbstractLocation.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/location/basic/AbstractLocation.java b/core/src/main/java/brooklyn/location/basic/AbstractLocation.java
index 7cfb51f..808653f 100644
--- a/core/src/main/java/brooklyn/location/basic/AbstractLocation.java
+++ b/core/src/main/java/brooklyn/location/basic/AbstractLocation.java
@@ -167,7 +167,7 @@ public abstract class AbstractLocation implements LocationInternal, HasHostGeoIn
         Location oldParent = parent.get();
         Set<Location> oldChildren = children;
         Map<String, Object> oldConfig = configBag.getAllConfig();
-        long oldCreationTimeUtc = creationTimeUtc.get();
+        Long oldCreationTimeUtc = creationTimeUtc.get();
         String oldDisplayName = name.get();
         HostGeoInfo oldHostGeoInfo = hostGeoInfo.get();
         


Mime
View raw message