[
https://issues.apache.org/jira/browse/LANG-1050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14174526#comment-14174526
]
ASF GitHub Bot commented on LANG-1050:
--------------------------------------
GitHub user jamessawle opened a pull request:
https://github.com/apache/commons-lang/pull/33
LANG-1050 Generic nullToEmpty method
A generic nullToEmpty method has been created. The idea was to use this as
a base for all of the wrapper class methods; however this would break the
contract they currently provide.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jamessawle/commons-lang LANG-1050
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/commons-lang/pull/33.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 #33
----
commit b13b977bea0246cfb439c2f4e21c0c9470d87cb7
Author: James Sawle <[email protected]>
Date: 2014-10-17T00:23:17Z
LANG-1050 Added new generic method to aid with defensive programming with
arrays.
----
> Change nullToEmpty methods to generics
> --------------------------------------
>
> Key: LANG-1050
> URL: https://issues.apache.org/jira/browse/LANG-1050
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Reporter: James Sawle
>
> Currently there are multiple Object based methods which could be replaced by
> a single generic method.
> - public static Long[] nullToEmpty(final Long[] array)
> - public static Integer[] nullToEmpty(final Integer[] array)
> - public static Short[] nullToEmpty(final Short[] array)
> - public static Character[] nullToEmpty(final Character[] array)
> - public static Byte[] nullToEmpty(final Byte[] array)
> - public static Double[] nullToEmpty(final Double[] array)
> - public static Float[] nullToEmpty(final Float[] array)
> - public static Boolean[] nullToEmpty(final Boolean[] array)
> Recommendation, replace all of these with a single method that would also
> allow a defensive programming style when not using wrapped primitives.
> - public static <T> T[] nullToEmpty(final T[] array)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)