brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #480: Config self reference fix
Date Fri, 17 Feb 2017 23:40:58 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/480#discussion_r101857293
  
    --- Diff: core/src/main/java/org/apache/brooklyn/util/core/task/TaskTags.java ---
    @@ -62,6 +62,7 @@ public static boolean isInessential(Task<?> task) {
         }
     
         public static boolean hasTag(Task<?> task, Object tag) {
    +        if (task==null) return false;
    --- End diff --
    
    On balance I'm fine with this because we use the same pattern in lots of places in Brooklyn.
But I think it's a bad pattern - it hides programming errors where null shouldn't have been
passed in, in exchange for a small number of callers getting to save a few characters by skipping
their null check. The former are so much more effort to fix that it's worth putting up with
the latter.


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