<AWT Dev> [9] Review Request: 8074028 Remove API references to java.awt.peer

Anton Tarasov anton.tarasov at oracle.com
Fri Mar 6 15:01:14 UTC 2015


Hi Sergey,

Looks good to me.

Thanks,
Anton.

On 04/03/15 15:37, Sergey Bylokhov wrote:
> Hello.
> Please review the fix for jdk 9.
> There are a number of public API whichreference the unsupported 
> java.awt.peer interfaces.
>
> public java.awt.Component.getPeer() @deprecated 1.1
> public java.awt.Font.getPeer() @deprecated 1.1
> public java.awt.MenuComponent.getPeer() @deprecated 1.1
>
> There is a decision to remove this methods as described: 
> http://mail.openjdk.java.net/pipermail/awt-dev/2015-February/008924.html
>
> Most important changes:
> http://cr.openjdk.java.net/~serb/8074028/webrev.05/src/java.desktop/share/classes/java/awt/Component.java.sdiff.html 
>
> -    /**
> -     * @deprecated As of JDK version 1.1,
> -     * programs should not directly manipulate peers;
> -     * replaced by <code>boolean isDisplayable()</code>.
> -     * @return the peer for this component
> -     */
> -    @Deprecated
> -    public ComponentPeer getPeer() {
> -        return peer;
> -    }
>
> Component.getPeer was removed and its usage was replaced by:
>  - dirrect access to the field if possible
>  - (getPeer() !=/== null) is replaced by the isDisplayable()
>  - All other places now use an AWTAccessor.
>
> http://cr.openjdk.java.net/~serb/8074028/webrev.05/src/java.desktop/share/classes/java/awt/MenuComponent.java.sdiff.html 
>
> -    /**
> -     * @deprecated As of JDK version 1.1,
> -     * programs should not directly manipulate peers.
> -     * @return the peer for this component
> -     */
> -    @Deprecated
> -    public MenuComponentPeer getPeer() {
> -        return peer;
> -    }
>
> MenuComponentPeer.getPeer was removed, now we use an AWTAccessor instead.
>
> http://cr.openjdk.java.net/~serb/8074028/webrev.05/src/java.desktop/share/classes/java/awt/Font.java.sdiff.html 
>
> Font.getPeer() access was changed to the private, because it is not 
> simple getter, and it is used in native code. On the java side now we 
> use an AWTAccessor.
>
> Also I tried to fix the open tests, but not sure that I cover all of 
> them. I'll fix other tests in the separate CR.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8074028
> Webrev can be found at: 
> http://cr.openjdk.java.net/~serb/8074028/webrev.05
>



More information about the awt-dev mailing list