Regarding null safe oprators

Paulo Levi i30817 at gmail.com
Wed Jul 15 16:49:24 PDT 2009


Someone on another message on this very topic sent this method:
    public static <E> Iterable<E> maybe(Iterable<E> iterable) {
        return iterable == null ? Collections.<E>emptyList() : iterable;
    }
used like this:
     for(String s : maybe(list)){
      ...
      }

Me i consider a null list a bug.



More information about the coin-dev mailing list