Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 25
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: