RFR: 8325851: Hide PassFailJFrame.Builder constructor
Phil Race
prr at openjdk.org
Mon Mar 11 22:12:13 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.
test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 1070:
> 1068: }
> 1069:
> 1070: public Builder title(String title) {
So what about this one ? Are too many tests using it ?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18206#discussion_r1520485829
More information about the client-libs-dev
mailing list