<AWT Dev>  Review Request: 8074757 Remove java.awt.Toolkit methods which return peer types
Sergey.Bylokhov at oracle.com
Tue Apr 7 14:28:45 UTC 2015
On 03.04.15 20:14, Phil Race wrote:
> It does not need to be deprecated. It can be 'undeprecated' It was
> deprecated only because
> it was the public Toolkit method that is now gone ..
Ok, I'll update it.
> So perhaps there's just a small adjustment needed in the case of where
> we use createComponent() ??
It is used in 3 places:
- Indirectly in Canvas and Panel where our headless toolkits creates
NullComponentPeer instead of the native peer. So the question is this is
implementation detail of our headless toolkit or all such toolkits
should use the same things.
- In Component class I can reuse NullComponentPeer, but it is unclear
how we survive this later when external tollkit is in use.
If nobody objects then I suggest for now to use this new error as an
assertion to find possible usage of these methods, instead of silent
usage of some empty stub, and fail sometime later with unclear reason.
>>> On 04/02/2015 08:15 AM, Sergey Bylokhov wrote:
>>>> 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
>>>> There is a decision to remove these references as described:
>>>> 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:
>> Best regards, Sergey.
Best regards, Sergey.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the awt-dev