Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/919#discussion_r41605652
  
    --- Diff: 
utils/common/src/main/java/org/apache/brooklyn/util/text/StringFunctions.java 
---
    @@ -67,6 +70,15 @@ public String apply(@Nullable Object[] input) {
                 }
             };
         }
    +    
    +    /** given e.g. "hello %s %s" returns a function which will insert an 
Iterable of two strings into that pattern */
    +     public static Function<Iterable<?>, String> 
formatterForIterable(final String pattern) {
    +        return new Function<Iterable<?>, String>() {
    +            public String apply(@Nullable Iterable<?> input) {
    +                return String.format(pattern, Iterables.toArray(input, 
Object.class));
    --- End diff --
    
    This will NPE if `input` is null, yet the parameter is marked `@Nullable`. 
Should we remove the annotation, or explicitly check for null (e.g. to return 
null if input is null)?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to