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

Listeners added to Node.getPseudoClassStates() will suddenly stop receiving

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: openjfx12
    • Fix Version/s: openjfx14
    • Component/s: javafx
    • Labels:
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      A DESCRIPTION OF THE PROBLEM :
      The method Node.getPseudoClassStates() returns an umodifiable wrapper of a Nodes active pseudo-class states. Since every call creates a new wrapper instance, the caller needs to save a strong reference to the result of the method. Otherwise the wrapper will eventually be collected by the GC and therefore listeners added to this wrapper will no longer receive events from the underlying collection.
      This behavior is surprising because similar API like TableView.getVisibleLeafColumns() will always return the same unmodifiable wrapper.


      CUSTOMER SUBMITTED WORKAROUND :
      Callers can manage a strong reference to a wrapper returned by Node.getPseudoClassStates() to prevent premature garbage collection.

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              arapte Ambarish Rapte
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: