Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1050

Change nullToEmpty methods to generics

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Implemented
    • None
    • 3.5
    • lang.*
    • None

    Description

      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)

      Attachments

        Activity

          People

            dmjones500 Duncan Jones
            jamessawle James Sawle
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: