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

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: jfx12
    • Component/s: javafx
    • x86_64
    • windows_10

      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


            Assignee:
            Ambarish Rapte
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: