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

(str) String.EMPTY_STRING_ARRAY constant

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      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.
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: