+1

2007/9/21, Vincent Massol <[EMAIL PROTECTED]>:
> Hi,
>
> Since this is an API I'm sending a vote.
>
> I'd like to modify the following:
>
>      public List search(String wheresql) throws XWikiException
>      {
>          if (hasProgrammingRights())
>              return xwiki.search(wheresql, getXWikiContext());
>          return null;
>      }
>
> To:
>
>      public List search(String wheresql) throws XWikiException
>      {
>          if (hasProgrammingRights())
>              return xwiki.search(wheresql, getXWikiContext());
>          return Collections.EMPTY_LIST;
>      }
>
> Rationale:
>
> * A method that returns a List (or a Collection in general) should
> never return null but always an empty collection instead (or throw an
> exception).
>
> I also propose to modify the other methods to return empty
> collections instead of null. Those include:
>
> *     public List getDeletedDocuments(String fullname, String lang)
> throws XWikiException
> *     public List search(String wheresql, int nb, int start) throws
> XWikiException
> *     public List searchDocuments(String wheresql, int nb, int start,
> String selectColumns)
>
> Here's my +1
>
> Thanks
> -Vincent
>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
>


-- 
Thomas Mortagne
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to