Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5047879

(str) String.EMPTY_STRING_ARRAY constant

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.4.2
    • core-libs
    • generic
    • generic

      Name: nl37777 Date: 05/14/2004

      It seems a constant in java.lang.String
           public static final String EMPTY_STRING_ARRAY = new String[0];
      could help avoid some unnecessary object creation and recycling. The
      J2SE sources currently contain over 50 occurrences of "new String[0]";
      many as arguments to Collection.toArray calls, some in the definition
      of private constants used for that purpose.

      There may be other classes for which an EMPTY_xxx_ARRAY constant would
      be useful.
      ======================================================================

            jgish Jim Gish (Inactive)
            nlindenbsunw Norbert Lindenberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: