<AWT Dev> Proposal: X11 Time stamp data should be unsigned

Ichiroh Takiguchi takiguc at linux.vnet.ibm.com
Mon Oct 8 02:20:25 UTC 2018


Hello.
Could you review the fix ?

Bug:    https://bugs.openjdk.java.net/browse/JDK-8211826
Change: https://cr.openjdk.java.net/~itakiguchi/8211826/webrev.00/

Thanks,
Ichiroh Takiguchi
IBM Japan, Ltd.

On 2018-06-19 22:22, Ichiroh Takiguchi wrote:
> Hello,
> IBM would like to contribute a patch to OpenJDK project.
> 
> Time stamp data on X11 ClientMessage should be 32 bit unsigned int.
> But it's converted to signed long on Java.
> It should be masked as unsigned 32bit data
> 
> I'd like to obtain a sponsor.
> 
> ----------
> ---
> old/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java
>        2018-06-19 22:10:49.313678852 +0900
> +++
> new/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java
>        2018-06-19 22:10:48.670692432 +0900
> @@ -620,7 +620,7 @@
> 
>          /* Time stamp - new in XDnD version 1. */
>          if (sourceProtocolVersion > 0) {
> -            time_stamp = xclient.get_data(3);
> +            time_stamp = xclient.get_data(3) & 0xFFFFFFFFL;
>          }
> 
>          /* User action - new in XDnD version 2. */
> @@ -867,7 +867,7 @@
>           */
>          if (dropAction == DnDConstants.ACTION_MOVE && success) {
> 
> -            long time_stamp = xclient.get_data(2);
> +            long time_stamp = xclient.get_data(2) & 0xFFFFFFFFL;
>              long xdndSelectionAtom =
>                  
> XDnDConstants.XDnDSelection.getSelectionAtom().getAtom();
> 
> --- old/src/java.desktop/unix/classes/sun/awt/X11/XMSelection.java
>    2018-06-19 22:10:50.223659632 +0900
> +++ new/src/java.desktop/unix/classes/sun/awt/X11/XMSelection.java
>    2018-06-19 22:10:49.576673297 +0900
> @@ -200,7 +200,7 @@
>              if (log.isLoggable(PlatformLogger.Level.FINE)) {
>                  log.fine("client messags = " + xce);
>              }
> -            long timestamp = xce.get_data(0);
> +            long timestamp = xce.get_data(0) & 0xFFFFFFFFL;
>              long atom = xce.get_data(1);
>              long owner = xce.get_data(2);
>              long data = xce.get_data(3);
> ----------
> 
> Thanks,
> Ichiroh Takiguchi
> IBM Japan, Ltd.



More information about the awt-dev mailing list