Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8133104

JavaFX: clipboardCorrection in JFXPanel introduced a new bug in update 51

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • 9
    • 8u51
    • javafx
    • x86
    • windows_8

      FULL PRODUCT VERSION :
      java version "1.8.0_51"
      Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
      Java HotSpot(TM) Client VM (build 25.51-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      All - Windows, MacOS X, Linux

      A DESCRIPTION OF THE PROBLEM :
      Related to https://bugs.openjdk.java.net/browse/JDK-8093960

      The javafx.embed.swing.JFXPanel class contains methodCheckPasteboard, where inside code is checking for "getDeclaredMethod("checkPasteboard");" for class "sun.lwawt.macosx.CClipboard"

      Main issue here, in Java 8 update 51 the class "sun.lwawt.macosx.CClipboard" does not have this method -> after refactoring comes 2 methods:
       - checkPasteboardNotify
       - checkPasteboardNotifyAll

      *** JFXPanel related code ***
          private static ThreadLocal<Method> methodCheckPasteboard =
              new ThreadLocal<Method>() {
                  @Override protected Method initialValue() {
                      if (classCClipboard.get() != null) {
                          try {
                              Method m = classCClipboard.get().getDeclaredMethod("checkPasteboard");
                              m.setAccessible(true);
                              return m;
                          } catch (Exception ex) {
                              if (log.isLoggable(Level.FINE)) {
                                  log.fine(ex.getMessage());
                              }
                          }
                      }
                      return null;
                  }
              };



      Java 8 update 45 contains (class sun.lwawt.macosx.CClipboard):
      /**
           * Invokes native check whether a change count on the general pasteboard is different
           * than when we set it. The different count value means the current owner lost
           * pasteboard ownership and someone else put data on the clipboard.
           * @since 1.7
           */
          public native void checkPasteboard();

      Java 8 update 51 has 2 methods... Someone forgot to sync JFXPanel "reflection" call with changes in sun.lwawt.macosx.CClipboard class.

      REGRESSION. Last worked in version 8u51


      REPRODUCIBILITY :
      This bug can be reproduced always.

      SUPPORT :
      YES

            vadim Vadim Pakhnushev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: