JDK-8325851 : Hide PassFailJFrame.Builder constructor
  • Type: Bug
  • Component: client-libs
  • Affected Version: 22
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-02-14
  • Updated: 2024-09-02
  • Resolved: 2024-03-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 21 JDK 23 JDK 8
11.0.26-oracleFixed 17.0.14-oracleFixed 21.0.6-oracleFixed 23 b15Fixed 8u441Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
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.
Comments
Changeset: 3b9255eb Author: Alexey Ivanov <aivanov@openjdk.org> Date: 2024-03-14 10:57:30 +0000 URL: https://git.openjdk.org/jdk/commit/3b9255eb663b4c90aa5cec89f0d9380ef8eba49e
14-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/18206 Date: 2024-03-11 21:18:40 +0000
11-03-2024