<AWT Dev> [9] Review Request: 8074757 Remove java.awt.Toolkit methods which return peer types

Alan Bateman Alan.Bateman at oracle.com
Fri Apr 3 16:40:28 UTC 2015



On 02/04/2015 16:15, Sergey Bylokhov wrote:
> Hello.
> Please review the fix for jdk 9.
> There are a number of public methods in the java.awt.Toolkit class, 
> which reference the unsupported java.awt.dnd.peer and java.awt.peer 
> interfaces.
>
> There is a decision to remove these references as described: 
> http://mail.openjdk.java.net/pipermail/awt-dev/2015-February/008924.html
> Changes description:
>  - All such methods were moved from Toolkit.java to the 
> ComponentFactory.java. Note that all our toolkits implement 
> ComponentFactory interface.
>  - HToolkit, HeadlessToolkit, SunToolkit were cleared because they 
> have the same implementation of these methods as in ComponentFactory.
>  - The questionable moment is that I throw an AWTError in a some 
> places if a default toolkit not implements ComponentFactory interface.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8074757
> Webrev can be found at: 
> http://cr.openjdk.java.net/~serb/8074757/webrev.04
>
The removal of the methods from Toolkit look good to me.

On the point about AWTError then I assume that this would only happen a 
special build, maybe an untested port. Or maybe there are other way to 
configure AWT to use an alternative toolkit implementation at runtime?

-Alan


More information about the awt-dev mailing list