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


##########
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:
   it's possible but we might decide to remove the logging at some point so i 
prefer to always clear



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to