Commons Lang
  1. Commons Lang
  2. LANG-267

Support char array converters on ArrayUtils

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:
      None

      Description

      I don't know it the following methods have been overlooked, but they will make a fine addition to ArrayUtils:

      public static char[] toPrimitive(Character[] array)
      public static char[] toPrimitive(Character[] array, char valueForNull)
      public static Object[] toObject(char[] array)

      1. ArrayUtils.txt
        3 kB
        Andres Almiray
      2. commons-lang_ArrayUtils.patch
        3 kB
        Andres Almiray
      3. commons-lang_ArrayUtils-with-test.patch
        6 kB
        Andres Almiray

        Activity

        Hide
        Andres Almiray added a comment -

        Implementation based on similar methods

        Show
        Andres Almiray added a comment - Implementation based on similar methods
        Hide
        Henri Yandell added a comment -

        They seem like fine additions. Patches definitely welcomed (then I can push it in to the 2.2 release).

        Show
        Henri Yandell added a comment - They seem like fine additions. Patches definitely welcomed (then I can push it in to the 2.2 release).
        Hide
        Andres Almiray added a comment -

        Here is the code in patch format

        Show
        Andres Almiray added a comment - Here is the code in patch format
        Hide
        Henri Yandell added a comment -

        Ugh - sorry for not noticing you'd already attached the ArrayUtils.txt, Andres.

        Do you have any time to write a unit test for each method?

        Show
        Henri Yandell added a comment - Ugh - sorry for not noticing you'd already attached the ArrayUtils.txt, Andres. Do you have any time to write a unit test for each method?
        Hide
        Andres Almiray added a comment -

        Yes, of course. I'm terribly sorry for forgetting the test, I left it behind =)

        Show
        Andres Almiray added a comment - Yes, of course. I'm terribly sorry for forgetting the test, I left it behind =)
        Hide
        Henri Yandell added a comment -

        Resolved in time for 2.2:

        svn ci -m "Adding the missing char/Character methods in ArrayUtils, as pointed out (and pat
        ched) by Andres Almiray in LANG-267" src/java/org/apache/commons/lang/ArrayUtils.java src/test/org/apache/commons/lang/ArrayUtilsTest.java
        Sending src/java/org/apache/commons/lang/ArrayUtils.java
        Sending src/test/org/apache/commons/lang/ArrayUtilsTest.java
        Transmitting file data ..
        Committed revision 419122.

        Show
        Henri Yandell added a comment - Resolved in time for 2.2: svn ci -m "Adding the missing char/Character methods in ArrayUtils, as pointed out (and pat ched) by Andres Almiray in LANG-267 " src/java/org/apache/commons/lang/ArrayUtils.java src/test/org/apache/commons/lang/ArrayUtilsTest.java Sending src/java/org/apache/commons/lang/ArrayUtils.java Sending src/test/org/apache/commons/lang/ArrayUtilsTest.java Transmitting file data .. Committed revision 419122.
        Hide
        ggregory@seagullsw.com added a comment -

        Is [lang] the right project for this instead of [primitives]? Where do we draw the line between [primitives] and [lang]?

        Show
        ggregory@seagullsw.com added a comment - Is [lang] the right project for this instead of [primitives] ? Where do we draw the line between [primitives] and [lang] ?
        Hide
        Stephen Colebourne added a comment -

        [lang] is the correct location, as [primitives] is solely about priimtive implementations of collections

        Show
        Stephen Colebourne added a comment - [lang] is the correct location, as [primitives] is solely about priimtive implementations of collections

          People

          • Assignee:
            Unassigned
            Reporter:
            Andres Almiray
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development