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

ListChangeListener.wasUpdated: Javadocs and method return value differ

XMLWordPrintable

    • x86_64
    • linux

      A DESCRIPTION OF THE PROBLEM :
      https://github.com/openjdk/jfx/blob/6bd0e22d7e33a7e24f17a351914c9ab78a0c3398/modules/javafx.base/src/main/java/javafx/collections/ListChangeListener.java#L227

              /**
               * Indicates that the elements between {@link #getFrom()} (inclusive)
               * to {@link #getTo()} exclusive has changed.
               * This is the only optional event type and may not be
               * fired by all ObservableLists.
               * @return true if the current change is an update change.
               * @since JavaFX 2.1
               */
              public boolean wasUpdated() {
                  return false;
              }

      The Javadocs suggest this method can return true. The code suggests otherwise.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      No steps, this is clearly a bug.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The wasUpdated method should return true under some condition.
      ACTUAL -
      The wasUpdated method always returns false.

      ---------- BEGIN SOURCE ----------
      Not applicable, the implementation is incorrect.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Code must implement conditional logic using logical OR involving the other was* methods.

      FREQUENCY : always


            kcr Kevin Rushforth
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: