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.
======================================================================
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.
======================================================================
- relates to
-
JDK-6677285 (str) String.EMPTY_STRING static constant
-
- Closed
-