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

{List,Set,Map}PropertyBase::bind should check against identity

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8, openjfx11, openjfx16
    • Fix Version/s: openjfx17
    • Component/s: javafx
    • Labels:
      None
    • Environment:

      All platforms, all versions

    • Subcomponent:

      Description

      ListPropertyBase::bind, SetPropertyBase::bind, MapPropertyBase::bind have a check on whether a different instance of the observable is the same, but it should check againts identity.

      The attached test shows how these three properties fail when binding is called twice without unbinding first:

      This fails to produce the expected result:

      c.bind(a);
      c.bind(b);
       
      while this is the required workaround to make it work:

      c.bind(a);
      c.unbind(); // need to explicitly unbind
      c.bind(b);

      According to https://bugs.openjdk.java.net/browse/JDK-8094799, the ListExpressionHelper::fireValueChangedEvent was modified precisely to test against identity.

      If such change is done in bind() for these three methods, the workaround (unbinding) wouldn't be necessary.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jpereda Jose Pereda
              Reporter:
              jpereda Jose Pereda
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: