Github user tbouron commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/917#discussion_r158235800
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java ---
    @@ -749,13 +756,15 @@ public Application getApplication() {
         // FIXME Can this really be deleted? Overridden by 
AbstractApplication; needs careful review
         /** @deprecated since 0.4.0 should not be needed / leaked outwith 
brooklyn internals / mgmt support? */
         @Deprecated
    -    protected synchronized void setApplication(Application app) {
    -        if (application != null) {
    -            if (application.getId() != app.getId()) {
    -                throw new IllegalStateException("Cannot change application 
of entity (attempted for "+this+" from "+getApplication()+" to "+app);
    +    protected void setApplication(Application app) {
    +        synchronized (appMutex) {
    --- End diff --
    
    @aledsage Is it the right place to synchronize as this method is 
`deprecated`? It looks like the answer is yes but just wanted to check.
    
    Do you think the `@Deprecated` annotation can be removed? Or at least the 
`FIXME` comment?


---

Reply via email to