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

Wrong implementation of VMState.hasListener

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b13
    • CPU:
      x86_64
    • OS:
      windows_10

      Backports

        Description

        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.


          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: