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: simplify yaml for averaging + sum...
Date Tue, 21 Apr 2015 17:46:06 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/605#discussion_r28803369
  
    --- Diff: core/src/main/java/brooklyn/enricher/Enrichers.java ---
    @@ -216,13 +219,25 @@ public B fromHardcodedProducers(Iterable<? extends Entity>
val) {
                 this.fromHardcodedProducers = ImmutableSet.copyOf(val);
                 return self();
             }
    +        @SuppressWarnings({ "unchecked", "rawtypes" })
             public B computing(Function<? super Collection<S>, ? extends T> val)
{
    -            this.computing = checkNotNull(val);
    +            this.computingSupplier = (Supplier)Suppliers.ofInstance(checkNotNull(val));
                 return self();
             }
    -        @SuppressWarnings({ "unchecked", "rawtypes" })
             public B computingSum() {
    -            // relies of TypeCoercion of result from Number to T, and type erasure for
us to get away with it!
    +            this.computingSupplier = new Supplier<Function<? super Collection<S>,
? extends T>>() {
    --- End diff --
    
    Oh I see it now, shouldn't trust github's enclosing scope method signature.


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