On Tue, 16 Sep 2025 19:23:06 GMT, Alexey Ivanov <[email protected]> wrote:

> Code review https://git.openjdk.org/jdk/pull/27197 for 
> [JDK-8367348](https://bugs.openjdk.org/browse/JDK-8367348) made me think how 
> to avoid adding more parameters to methods, in particular 
> `createInstructionUIPanel`. The `Builder` object captures all the required 
> configuration data, it is the `Builder` object that should be used to pass 
> the configuration.
> 
> This changeset refactors UI creation in `PassFailJFrame`.
> 
> * The remaining constructor that accepts positional parameters now creates a 
> builder to pass the configuration data.
> * The `createInstructionUIPanel` method now accepts `Builder` instead of a 
> set of parameters from it.
> * The `createUI` method with positional parameters has become redundant and 
> is removed. Code duplication between two versions of `createUI` is now 
> eliminated.
> 
> There are no functional differences. I verified it by launching a few tests 
> which use `PassFailJFrame` constructors and builder.

test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 1846:

> 1844:                 InvocationTargetException {
> 1845:             try {
> 1846:                 validate();

Do you know when `build` is invoked? I see this `validate` is removed in favor 
of having `builder.validate()` on line 508. Overall, the changes look like 
they're cleanly refactored but this is the biggest change I see, although minor.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27321#discussion_r2392428585

Reply via email to