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

Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 25
    • None
    • client-libs
    • b24

                  SelectiveAWTEventListener selectiveListener =
                      listener2SelectiveListener.get(localL);

                  if (selectiveListener != null) {
                      listener2SelectiveListener.remove(localL);

      There is no need to call WeakHashMap.get + WeakHashMap.remove.
      Instead we can call only remove and compare result with null.

            aturbanov Andrey Turbanov
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: