[
https://issues.apache.org/jira/browse/LANG-1050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14484958#comment-14484958
]
Duncan Jones commented on LANG-1050:
------------------------------------
I'm happy to take a look at this. But I'm struggling to apply the patch (I
don't currently use git locally). I tried to apply
https://patch-diff.githubusercontent.com/raw/apache/commons-lang/pull/33.patch,
but it was rejected:
{noformat}
C:\Users\Duncan\workspace\lang>svn patch --dry-run C:\tmp\33.patch.txt
U src\main\java\org\apache\commons\lang3\ArrayUtils.java
> applied hunk @@ -462,6 +462,23 @@ with offset 2
U src\test\java\org\apache\commons\lang3\ArrayUtilsTest.java
> applied hunk @@ -363,6 +363,31 @@ with offset -7
C src\main\java\org\apache\commons\lang3\ArrayUtils.java
> rejected hunk @@ -465,9 +465,13 @@
U src\test\java\org\apache\commons\lang3\ArrayUtilsTest.java
> applied hunk @@ -32,7 +32,9 @@ with offset -7
> applied hunk @@ -42,6 +44,9 @@ with offset -7
> applied hunk @@ -390,6 +395,15 @@ with offset -32 and fuzz 1
C src\test\java\org\apache\commons\lang3\ArrayUtilsTest.java
> rejected hunk @@ -25,9 +25,15 @@
> rejected hunk @@ -37,9 +43,6 @@
> rejected hunk @@ -387,11 +390,8 @@
Summary of conflicts:
Text conflicts: 2
{noformat}
Could you kindly confirm the patch is still valid and, if so, attach an SVN
patch to this issue for review? I think until we make the complete transition
to GitHub, that's the "official" way of providing a patch.
> 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: Review Patch
>
>
> 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)