jcabrerizo commented on code in PR #1320:
URL: https://github.com/apache/brooklyn-server/pull/1320#discussion_r895612711


##########
core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java:
##########
@@ -484,11 +483,23 @@ protected void instantiateLocationsAndEntities() {
         }
     }
 
+    protected Map<String,EntityAdjunct> adjunctProxies = MutableMap.of();
+    protected <T extends EntityAdjunct> T createAdjunctProxy(Class<T> 
adjunctType, String id) {
+        return (T) adjunctProxies.computeIfAbsent(id, (id2) -> 
EntityAdjuncts.createProxy(adjunctType, null) );
+    }
+
     protected void instantiateMementos() throws IOException {
 
         checkEnteringPhase(4);
 
+        if (!adjunctProxies.isEmpty()) {
+            LOG.warn("Had stale adjunct information when rebinding; ignoring: 
"+adjunctProxies);
+        }
+        adjunctProxies.clear();
+

Review Comment:
   Clear is only need if is not empty, moving this inside the exiting `if` 
above will be a minor improve



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to