{"version":"1.0","provider_name":"Hatena Blog","blog_title":"\u9811\u5f35\u3063\u3066\u7d9a\u3051\u307e\u3059","url":"https://maximilianahead.hatenadiary.org/entry/20130520/1369064368","description":"\u524d\u306b\u4ed5\u4e8b\u3067\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u4e2d\u306b\u5931\u6557\u3057\u305f\u3053\u3068\u3002null\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5909\u6570\u306b\u5bfe\u3057\u3066foreach\u6587\u3092\u3042\u3066\u304c\u3046\u3068\u3001Null\u3061\u3093\u307d\u3053\u4f8b\u5916\u304c\u8d77\u3053\u308b\u3002 \u4e8b\u524d\u306bNull\u30c1\u30a7\u30c3\u30af\u3092\u3057\u305f\u3044\u304c\u3001 if ( collection != null ) foreach... \u306a\u3093\u3066\u3060\u3055\u3044\u3002 public class Main { static <T> Iterable<T> nullGuard(Iterable<T> iter) { return iter == null ? Collections.<T>emptyList() : iter; } public static void main(String[] args\u2026","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmaximilianahead.hatenadiary.org%2Fentry%2F20130520%2F1369064368\" title=\"foreach Null\u30c1\u30a7\u30c3\u30af - \u9811\u5f35\u3063\u3066\u7d9a\u3051\u307e\u3059\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":["java"],"provider_url":"https://hatena.blog","author_name":"maximilianahead","author_url":"https://blog.hatena.ne.jp/maximilianahead/","blog_url":"https://maximilianahead.hatenadiary.org/","width":"100%","published":"2013-05-20 00:39:28","image_url":null,"type":"rich","title":"foreach Null\u30c1\u30a7\u30c3\u30af"}