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

Hide PassFailJFrame.Builder constructor

XMLWordPrintable

    • b21
    • 22
    • b15

        The PassFailJFrame.Builder class provides a way to configure the parameters of PassFailJFrame in a set of chained method calls.

        The Builder class is public and has public constructor. At the same time, a better design would be to hide all the Builder constructors and rely on the builder() method which returns an instance of the Builder.

        At the same time, the builder() helper wasn't available until JDK-8294156 which was integrated in October 2023 whereas the Builder class became available with JDK-8294535 in August 2023.

        For this reason, there are 20 tests which create the PassFailJFrame.Builder object using its constructor instead of the helper method. These tests have to be updated.

        To find these tests, run:
        grep -r 'new PassFailJFrame.Builder' test/jdk

        Hiding the PassFailJFrame.Builder constructor is a better design choice. New tests should not create the builder using the `new` keyword. To enforce it, the Builder constructor needs to be private.

              aivanov Alexey Ivanov
              aivanov Alexey Ivanov
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: