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

(coll) Provide an EMPTY_ARRAY like you did for Collections.EMPTY_SET, etc.

XMLWordPrintable



      Name: rmT116609 Date: 10/02/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      I believe an EMPTY_ARRAY singleton would be even more useful than the already-
      existing EMPTY_SET, EMPTY_MAP, or EMPTY_LIST singletons. The declaration I am
      thinking of is:
          public static final Object[] EMPTY_ARRAY = { };

      Here are some core classes in JDK that already use their own copies of
      EMPTY_ARRAY.

      javax.swing.filechooser.WindowsFileSystemView
      javax.swing.filechooser.UnixFileSystemView
      javax.swing.filechooser.GenericFileSystemView
      javax.swing.JComboBox
      javax.swing.JList
      javax.swing.event.EventListenerList
      javax.swing.tree.DefaultMutableTreeNode
      (Review ID: 109229)
      ======================================================================

            martin Martin Buchholz
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: