-
Enhancement
-
Resolution: Fixed
-
P4
-
7
-
b48
-
generic
-
generic
The following proposal has come through the AWT-DEV mailing list.
----------------
The peer interfaces have a lot of duplicate methods, where one is
deprecated and 'replaced' by a new one (for example, preferredSize() and
getPreferredSize() ). I see that this makes sense for public API
_classes_ to maintain backward compatibility, but it does _not_ make
sense for interfaces. It only confuses those who have to implement those
interfaces (which method should I implement? Which one is called, and
which should call which?), and adds no value at all. Also: the new
interface methods are not used (i.e. called by AWT) at all. As part of
the Caciocavallo project I went through this stuff and removed the
duplicates, leaving the new methods in the interfaces and made AWT call
the new methods instead. There were also a couple of methods that are
never called from AWT (like ComponentPeer.repaint() ), which I also
removed (some of such methods are used, but only in the interface
implementation, so it is not required to have them in the public
interface). What do you think? Should this be merged into main JDK7?
Cheers, Roman
----------------
And here is the webrev of the suggested changes:
http://kennke.org/~roman/webrev/cleanpeers/webrev/
----------------
The peer interfaces have a lot of duplicate methods, where one is
deprecated and 'replaced' by a new one (for example, preferredSize() and
getPreferredSize() ). I see that this makes sense for public API
_classes_ to maintain backward compatibility, but it does _not_ make
sense for interfaces. It only confuses those who have to implement those
interfaces (which method should I implement? Which one is called, and
which should call which?), and adds no value at all. Also: the new
interface methods are not used (i.e. called by AWT) at all. As part of
the Caciocavallo project I went through this stuff and removed the
duplicates, leaving the new methods in the interfaces and made AWT call
the new methods instead. There were also a couple of methods that are
never called from AWT (like ComponentPeer.repaint() ), which I also
removed (some of such methods are used, but only in the interface
implementation, so it is not required to have them in the public
interface). What do you think? Should this be merged into main JDK7?
Cheers, Roman
----------------
And here is the webrev of the suggested changes:
http://kennke.org/~roman/webrev/cleanpeers/webrev/
- relates to
-
JDK-6749920 unnecessary method implementations in X11 and Windows peers
- Closed
-
JDK-6792515 specify awt peer's API
- Closed