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 #816: Tasks code improvements - prep for better...
Date Thu, 28 Sep 2017 12:52:27 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/816#discussion_r140608998
  
    --- Diff: utils/common/src/main/java/org/apache/brooklyn/util/repeat/Repeater.java ---
    @@ -269,6 +274,21 @@ public Boolean call() throws Exception {
             });
         }
     
    +    public <T> Repeater until(final Supplier<T> supplier, final Predicate<T>
exitCondition) {
    +        Preconditions.checkNotNull(supplier, "supplier must not be null");
    +        Preconditions.checkNotNull(exitCondition, "exitCondition must not be null");
    +        return until(new Callable<Boolean>() {
    +            @Override
    +            public Boolean call() throws Exception {
    +                return exitCondition.apply(supplier.get());
    +            }
    +            @Override
    +            public String toString() {
    +                return supplier.get()+" "+exitCondition.toString();
    --- End diff --
    
    Should the toString really call `supplier.get()`? I'd have just used the toString of the
supplier itself.


---

Mime
View raw message