brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Brooklyn node and cluster upgrade
Date Mon, 27 Oct 2014 21:51:32 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/272#discussion_r19440228
  
    --- Diff: utils/common/src/main/java/brooklyn/util/text/StringPredicates.java ---
    @@ -75,7 +141,22 @@ public String toString() {
             };
         }
         
    -    public static Predicate<CharSequence> containsAllLiterals(final String... fragments)
{
    +    // -----------------
    +    
    +    public static <T extends CharSequence> Predicate<T> containsAllLiterals(final
String... fragments) {
    --- End diff --
    
    I'd just go for the code below, as it feels a lot simpler to me:
    
        public static Predicate<CharSequence> containsAllLiterals(final String... fragments)
{
            List<Predicate<CharSequence>> fragmentPredicates = Lists.newArrayList();
            for (String fragment : fragments) {
                fragmentPredicates.add(containsLiteral(fragment));
            }
            return Predicates.and(fragmentPredicates);
        }



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