suppress some warnings

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

Branch: refs/heads/master
Commit: ab7519513254c7b6990b694caea9b425dbbbb1d5
Parents: bf7d292
Author: Alex Heneveld <[email protected]>
Authored: Fri Jul 7 12:54:14 2017 +0100
Committer: Alex Heneveld <[email protected]>
Committed: Fri Jul 7 12:54:14 2017 +0100

----------------------------------------------------------------------
 .../apache/brooklyn/core/location/BasicLocationRegistry.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ab751951/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java
 
b/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java
index cbfd140..b28e560 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java
@@ -39,6 +39,7 @@ import org.apache.brooklyn.api.location.LocationResolver;
 import org.apache.brooklyn.api.location.LocationSpec;
 import org.apache.brooklyn.api.mgmt.ManagementContext;
 import org.apache.brooklyn.api.typereg.BrooklynTypeRegistry;
+import org.apache.brooklyn.api.typereg.BrooklynTypeRegistry.RegisteredTypeKind;
 import org.apache.brooklyn.api.typereg.RegisteredType;
 import org.apache.brooklyn.config.StringConfigMap;
 import org.apache.brooklyn.core.config.ConfigPredicates;
@@ -214,8 +215,11 @@ public class BasicLocationRegistry implements 
LocationRegistry {
         
         // fall back to ignoring supertypes, in case they weren't set
         lt = mgmt.getTypeRegistry().get(nameOrId);
-        if (lt!=null) {
-            log.warn("Location registry only found "+nameOrId+" when ignoring 
supertypes; check it is correctly resolved.");
+        if (lt!=null && lt.getSuperTypes().isEmpty()) {
+            if (lt.getKind()!=RegisteredTypeKind.UNRESOLVED) {
+                // don't warn when still trying to resolve
+                log.warn("Location registry only found "+nameOrId+" when 
ignoring supertypes; check it is correctly resolved.");
+            }
             return newDefinedLocation(lt);
         }
         

Reply via email to