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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • jfx12
    • javafx
    • x86_64
    • 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

        Issue Links

          Activity

            People

              arapte Ambarish Rapte
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: