brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request: Fix BROOKLYN-271: Avoiding object ha...
Date Sat, 28 May 2016 14:23:55 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/146#discussion_r64989514
  
    --- Diff: core/src/main/java/org/apache/brooklyn/entity/group/zoneaware/ProportionalZoneFailureDetector.java
---
    @@ -56,4 +56,10 @@ protected boolean doHasFailed(Location loc, ZoneHistory zoneHistory)
{
                 return numDatapoints >= minDatapoints && proportionFailure >=
maxProportionFailures;
             }
         }
    +
    +    @Override
    +    public String toString(){
    +        return getClass().getName();
    --- End diff --
    
    I'd go for the code below (using `com.google.common.base.Objects`):
    
        @Override
        public String toString() {
            return Objects.toStringHelper(this)
                    .add("minDatapoints", minDatapoints)
                    .add("timeToConsider",  timeToConsider)
                    .add("maxProportionFailures", maxProportionFailures)
            .toString();
        }



---
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