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

Repeated ListProperty.bindContent() silently breaks the list

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8u40
    • 7u6, 8u25
    • javafx
    • None
    • Linux Ubuntu, Java 1.7.65, 1.8.25

      Run the program in the first comment. It prints out a plenty of a plenty of IndexOutOfBoundsException. Note that everything is running in a single thread.

      The problem is the following: it is possible to repeatedly bind a list property - no exception is thrown. But if we do it many times, the internal structures of the list property apparently get into an inconsistent state, and then add/remove operations sometimes fail with an IndexOutOfBoundsException.

      This is a very tricky error, because the repeated bind breaks the structures only sometimes, rather rarely, as can be seen from the program output. If one forgets to unbind the the list properly, it leads to rare and hard to reproduce IndexOutOfBoundsException on a different place of the application, when add/remove is called at a later point, with a seemingly unrelated stacktrace. Such exceptions are very hard to diagnose and debug.

            vadim Vadim Pakhnushev
            jmarekjfx Jan Marek (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: