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

TrayIcon passes itself to MouseEvent constructor generating ClassCastException

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10

      A DESCRIPTION OF THE PROBLEM :
      In native code TrayIcon creates a MouseEvent passing itself as the target BUT TrayIcon is not an awt Component.
      See here:
      https://github.com/openjdk/jdk/blob/master/src/java.desktop/windows/native/libawt/windows/awt_TrayIcon.cpp#L521
      This is ignored in OpenJDK but generates a ClassCastException in GraalVM
      See here:
      https://github.com/oracle/graal/issues/3414


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Attempt to use TrayIcon and compile in GraalVM

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Use TrayIcon
      ACTUAL -
      Native code generates a ClassCastException and fails.

      ---------- BEGIN SOURCE ----------
      See GraalVM bug.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None.

      FREQUENCY : always


        1. Capture.PNG
          23 kB
          Praveen Narayanaswamy
        2. Main.java
          3 kB
          Praveen Narayanaswamy

            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: