-
Enhancement
-
Resolution: Fixed
-
P3
-
1.3.0
-
beta2
-
generic
-
generic
Name: ssT124754 Date: 03/01/2001
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)
KeyEvent.setSource() takes an Object as its argument. Thus a KeyEvent's source
is not guaranteed to be a Component and the cast in
ComponentEvent.getComponent() may fail!
Is that original line of code
"return (source instanceof Component) ? (Component)source : null;"
really so expensive that it's worth all that trouble to avoid it? Remember that
ComponentEvent is not final and the source field (of type Object) is protected,
not private!
(Review ID: 117942)
======================================================================