GitHub user BruceKuiLiu opened a pull request:
https://github.com/apache/ant/pull/45
Consider returning a zero length array 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 "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/ant master6
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ant/pull/45.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 #45
----
commit ca2fbf36183b82457fe6d161b77a6b10ae2e457f
Author: Kui LIU <[email protected]>
Date: 2017-10-14T15:06:08Z
Consider returning a zero length array 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 "there is no answer to this
question" is probably appropriate.
http://findbugs.sourceforge.net/bugDescriptions.html#PZLA_PREFER_ZERO_LENGTH_ARRAYS
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]