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

Remove lockItemOnEdit flag from (Tree)TableCell

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • jfx22
    • jfx11
    • javafx
    • b04
    • generic
    • generic

      TreeTableCell and TableCell have a boolean flag that is called: lockItemOnEdit.
      This flag is always false in production.
      It is only changed by some JUnit tests to remove the need of setting up the whole table framework for the sake of just testing the cell.

      // We check the boolean lockItemOnEdit field here, as whilst we want to
      // updateItem normally, when it comes to unit tests we can't have the
      // item change in all circumstances.
      if (! lockItemOnEdit) {
          updateItem(-1);
      }

      This ticket proposes to remove this flag as it is irritating when checking out the sources.
      It is also not best practise to mix code (e.g. variables) into 'production' classes that are only needed for testing.
      Unlike package private methods we usually create and access via shims.

      To remove this flag, it can simply be attached to the shim instead.
      The shim then checks the flag instead. The flag is anyway accessed via a shim, so nothing will change on this side.

            mhanl Marius Hanl
            mhanl Marius Hanl
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: