brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CMoH <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Fix SshMachineLocation unable to ...
Date Thu, 23 Jul 2015 08:53:17 GMT
Github user CMoH commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/757#issuecomment-124025460
  
    The null value comes from ByonLocationResolver.extractConfig(), at https://github.com/apache/incubator-brooklyn/blob/master/core/src/main/java/brooklyn/location/basic/ByonLocationResolver.java#L97
    
        Integer port = (Integer) TypeCoercions.coerce(config.getStringKey("port"), Integer.class);
    
    When the port is missing from the config bag, null gets coerced to null and transitions
through until the call to getOptionalVal().
    
    In my understanding, an "optional" value should provide the default when missing - which
is the exact meaning of null. Whether it's missing from the property map, or it is mapped
to null should make no difference.
    
    The opposite interpretation would be to not put nulls in maps, which means the ByonLocationResolver
(and all similar client code) must implement such null checks.


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