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

Remove lockItemOnEdit flag from (Tree)TableCell

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: