brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #565: Be truly immediate/non-blocking more ofte...
Date Tue, 07 Mar 2017 12:41:37 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/565#discussion_r104656924
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/objs/AbstractConfigurationSupportInternal.java
---
    @@ -139,17 +132,19 @@ public T call() {
             // or Absent if the config key was unset.
             Object unresolved = getRaw(key).or(key.getDefaultValue());
             final Object marker = new Object();
    -        // Give tasks a short grace period to resolve.
    -        Object resolved = Tasks.resolving(unresolved)
    +        Maybe<Object> resolved = Tasks.resolving(unresolved)
                     .as(Object.class)
                     .defaultValue(marker)
                     .immediately(true)
                     .deep(true)
                     .context(getContext())
    -                .get();
    -        return (resolved != marker)
    -                ? TypeCoercions.tryCoerce(resolved, key.getTypeToken())
    -                        : Maybe.<T>absent();
    +                .getMaybe();
    +        if (resolved.isAbsent()) return Maybe.Absent.<T>castAbsent(resolved);
    +        if (resolved.get()==marker) {
    +            // TODO changed Feb 2017, previously returned absent, in contrast to what
the javadoc says
    --- End diff --
    
    Think you are correct here.  I've removed the use of `marker` altogether.


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