brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Prevent DynamicCluster NPE when s...
Date Tue, 20 Oct 2015 14:44:59 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/973#discussion_r42504649
  
    --- Diff: core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java
---
    @@ -170,7 +170,15 @@ public DynamicClusterImpl() {
         @Override
         public void init() {
             super.init();
    -        sensors().set(NEXT_CLUSTER_MEMBER_ID, new NextClusterMemberIdSupplier());
    +        initialiseMemberId();
    +    }
    +
    +    private void initialiseMemberId() {
    +        synchronized (mutex) {
    --- End diff --
    
    There's `sensors().modify(...)` which will do the same, but I would probably have implemented
it similarly to avoid the Java syntax overhead of anonymous classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message