You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ri...@apache.org on 2014/06/15 04:55:15 UTC

[2/3] git commit: Log when argument given to removeDefinedLocation is an unknown ID

Log when argument given to removeDefinedLocation is an unknown ID


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

Branch: refs/heads/master
Commit: 8a57342e405a44a4c30c6721ecff6f5347db9395
Parents: 911ff72
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Fri Jun 13 17:11:03 2014 +0100
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Fri Jun 13 17:11:03 2014 +0100

----------------------------------------------------------------------
 .../java/brooklyn/location/basic/BasicLocationRegistry.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/8a57342e/core/src/main/java/brooklyn/location/basic/BasicLocationRegistry.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/location/basic/BasicLocationRegistry.java b/core/src/main/java/brooklyn/location/basic/BasicLocationRegistry.java
index 035ba78..91e7d86 100644
--- a/core/src/main/java/brooklyn/location/basic/BasicLocationRegistry.java
+++ b/core/src/main/java/brooklyn/location/basic/BasicLocationRegistry.java
@@ -118,8 +118,12 @@ public class BasicLocationRegistry implements LocationRegistry {
 
     @Override
     public void removeDefinedLocation(String id) {
+        LocationDefinition removed;
         synchronized (definedLocations) { 
-            definedLocations.remove(id); 
+            removed = definedLocations.remove(id);
+        }
+        if (removed == null && log.isDebugEnabled()) {
+            log.debug("{} was asked to remove location with id {} but no such location was registered", this, id);
         }
     }