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

Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 17, 21, 25
    • client-libs
    • None
    • b26
    • generic
    • generic

      The issue was found here:
      https://github.com/openjdk/jdk/pull/24692#discussion_r2089545502

      AWTEventListener and AWTEventListenerProxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So removeAWTEventListener method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. so it is just a code clarification.

            serb Sergey Bylokhov
            serb Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: