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

Wrong implementation of VMState.hasListener

XMLWordPrintable

    • b13
    • x86_64
    • windows_10

        A DESCRIPTION OF THE PROBLEM :
        https://github.com/openjdk/jdk/blob/03721247d8f3d6b2aefe2826a59c10fd1fad51cb/src/jdk.jdi/share/classes/com/sun/tools/jdi/VMState.java#L176-L178

        shows that the implementation is still implemented in the same way as seen in JDK 1.8:

            synchronized boolean hasListener(VMListener listener) {
                return listeners.contains(listener);
            }

        listener is of type VMListener, while listeners is declared to contain WeakReference<VMListener>, so this method never returns true.

        removeListener(VMListener listener) is implemented correctly.


              fmatte Fairoz Matte
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: