You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2017/02/28 22:57:10 UTC
[1/2] brooklyn-server git commit: could get NPE if application was
GC'd at same time as location, do not fail in that case
Repository: brooklyn-server
Updated Branches:
refs/heads/master 442261741 -> 0b18b6cb9
could get NPE if application was GC'd at same time as location, do not fail in that case
we want to make sure a record is generated, even if it is incomplete
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/43a456f9
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/43a456f9
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/43a456f9
Branch: refs/heads/master
Commit: 43a456f97bf39faa409c88e431382c60a25ff724
Parents: 17aa622
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Tue Feb 28 12:57:12 2017 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Tue Feb 28 12:57:12 2017 +0000
----------------------------------------------------------------------
.../org/apache/brooklyn/core/mgmt/usage/LocationUsage.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/43a456f9/core/src/main/java/org/apache/brooklyn/core/mgmt/usage/LocationUsage.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/usage/LocationUsage.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/usage/LocationUsage.java
index 7d4013f..aef2be2 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/usage/LocationUsage.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/usage/LocationUsage.java
@@ -27,6 +27,7 @@ import java.util.Map;
import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
@@ -52,7 +53,8 @@ public class LocationUsage {
this.state = checkNotNull(state, "state");
this.entityId = checkNotNull(entityId, "entityId");
this.entityType = checkNotNull(entityType, "entityType");
- this.applicationId = checkNotNull(applicationId, "applicationId (entity "+entityId+")");
+ // application ID can be null if hierarchy has been destroyed in parallel; better to record the event than fail
+ this.applicationId = applicationId==null ? "" : applicationId;
this.user = user;
}
@@ -96,7 +98,7 @@ public class LocationUsage {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("date", date)
.add("state", state)
.add("entityId", entityId)
@@ -135,7 +137,7 @@ public class LocationUsage {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("locationId", locationId)
.toString();
}
[2/2] brooklyn-server git commit: This closes #574
Posted by al...@apache.org.
This closes #574
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/0b18b6cb
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/0b18b6cb
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/0b18b6cb
Branch: refs/heads/master
Commit: 0b18b6cb904584fa041383b7a0875afc09ee8210
Parents: 4422617 43a456f
Author: Aled Sage <al...@gmail.com>
Authored: Tue Feb 28 22:56:40 2017 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Tue Feb 28 22:56:40 2017 +0000
----------------------------------------------------------------------
.../org/apache/brooklyn/core/mgmt/usage/LocationUsage.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------