commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duncan Jones (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LANG-1050) Change nullToEmpty methods to generics
Date Thu, 09 Apr 2015 06:30:14 GMT

     [ https://issues.apache.org/jira/browse/LANG-1050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Duncan Jones resolved LANG-1050.
--------------------------------
       Resolution: Implemented
    Fix Version/s:     (was: Review Patch)
                   3.5

Thanks for the patch James. Now applied to trunk:

Author: djones
Date: Thu Apr  9 06:27:15 2015
New Revision: 1672244

URL: http://svn.apache.org/r1672244
Log:
Implements LANG-1050: Change nullToEmpty methods to generics. Thanks to James Sawle. This
closes #33 in GitHub too.

Modified:
    commons/proper/lang/trunk/src/changes/changes.xml
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java

> 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
>            Assignee: Duncan Jones
>             Fix For: 3.5
>
>
> 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)

Mime
View raw message