-
Bug
-
Resolution: Fixed
-
P4
-
1.4.1
-
mantis
-
generic
-
generic
###@###.### 2002-07-16
FocusEvents in JDK 1.4.1 provides a reference to the "opposite"
component...that is a reference to the component which lost focus when your
component gains focus, and a reference to the component that gained focus
when your component lost focus.
That's great, but FocusEvent is Serializable and field focusEvent.opposite
is not transient.
Therefore, cannot ship FocusEvents over RMI without serializing whatever
component is the opposite component.
java.awt.event.FocusEvent and most other events ultimately derive
from java.util.EventObject, which contains the following:
public class EventObject implements java.io.Serializable {
/**
* The object on which the Event initially occurred.
*/
protected transient Object source;
:
:
Thus, if you serialize an event, the source that you get on deserialization
will be null.
The opposite component in FocusEvent should work the same way, even if only
for consistency. (Both source and opposite refer to components at the time
the event object was created.)
We believe null is the *only* reasonable value upon deserialization,
especially given that source will be null.
- relates to
-
JDK-4759974 Field WindowEvent.opposite should be transient
- Resolved