aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BruceKuiLiu <...@git.apache.org>
Subject [GitHub] aries pull request #80: Consider returning a zero length array of String rat...
Date Mon, 09 Oct 2017 21:49:32 GMT
GitHub user BruceKuiLiu opened a pull request:

    https://github.com/apache/aries/pull/80

    Consider returning a zero length array of String rather than null.

    It is often a better design to return a length zero array rather than a null reference
to indicate that there are no results (i.e., an empty list of results).
    This way, no explicit check for null is needed by clients of the method.
    On the other hand, using null to indicate that "there is no answer to this question" is
probably appropriate.
    http://findbugs.sourceforge.net/bugDescriptions.html#PZLA_PREFER_ZERO_LENGTH_ARRAYS

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/BruceKuiLiu/aries trunk-request

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/aries/pull/80.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #80
    
----
commit e2b3388df7f37bc518a6aeb1db415eba9ea26ff5
Author: Kui LIU <brucekuiliu@gmail.com>
Date:   2017-10-09T21:47:08Z

    Consider returning a zero length array of String rather than null.
    
    It is often a better design to return a length zero array rather than a null reference
to indicate that there are no results (i.e., an empty list of results).
    This way, no explicit check for null is needed by clients of the method.
    On the other hand, using null to indicate that "there is no answer to this question" is
probably appropriate.
    http://findbugs.sourceforge.net/bugDescriptions.html#PZLA_PREFER_ZERO_LENGTH_ARRAYS

----


---

Mime
View raw message