RFR: 8325851: Hide PassFailJFrame.Builder constructor

Harshitha Onkar honkar at openjdk.org
Tue Mar 12 17:00:16 UTC 2024


On Mon, 11 Mar 2024 21:18:40 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> The `Builder` class in `PassFailJFrame` is public and has a 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` class.
> 
> This PR makes the constructor of the `Builder` class private so that it's not accessible directly.
> 
> Use `PassFailJFrame.builder()` to get an instance of the builder and configure parameters of `PassFailJFrame`.
> 
> I updated all the tests which used the constructor directly by calling `new PassFailJFrame.Builder()`.
> 
> I converted a few tests to use the `testUI`, which greatly simplifies the test code. This change also removes flickering of the test UI.

PassFailJFrame's Builder changes and corresponding test changes look good.

-------------

Marked as reviewed by honkar (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18206#pullrequestreview-1931674713


More information about the client-libs-dev mailing list