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

Adding generics to all *Event classes

XMLWordPrintable

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

      Name: rmT116609 Date: 06/16/2004


      A DESCRIPTION OF THE REQUEST :
      It would be nice if all *Event classes used generics when calling update methods.

      JUSTIFICATION :
      It would eliminate unnessesary casts.


      ---------- BEGIN SOURCE ----------
      In java.util.Observer the update method:
      void update(Observable o, Object arg)
      could be changed to:
      void update(Observable o, E arg)
      and initialisation should look like this:
      new java.util.Observer<String>() {
        void update(Observable o, String arg) { ... do something ... }
      });
      ---------- END SOURCE ----------

      What I meant was that for instance java.util.Observer should be changed to:
      public interface Observer<E> {
            void update(Observable o, E arg);
      }
      (Incident Review ID: 280133)
      ======================================================================

            smarks Stuart Marks
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: