ITeye博客

Return zero length collections or arrays as opposed to returning null

bd2007 · 2011-08-02 17:37 · java · Web前端 · Markdown

Returning null instead of zerolength collection (use Collections.EMPTY_SET, Collections.EMPTY_LIST, Collections.EMPTY_MAP) is moreerror prone, since the programmer writing the calling method might forget to handle a return value of null.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。