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)
======================================================================
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)
======================================================================
- relates to
-
JDK-6458747 Generify java.util.EventListenerProxy
- Closed