RFR: 8340308: PassFailJFrame: Make rows default to number of lines in instructions
Alexey Ivanov
aivanov at openjdk.org
Tue Sep 17 14:03:03 UTC 2024
On Tue, 17 Sep 2024 13:45:06 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
> It has become quite common to use the following code
>
>
> .rows((int) INSTRUCTIONS.lines().count() + 1)
>
>
> to set the number of rows for `PassFailJFrame`.
>
> Make this the default value. Newer tests could drop `.rows` from builder configuration if the new default works well.
>
> If a test needs customising the new default value, the newly added method `rowsAdd` could be used to increase the number of rows.
There are currently 29 tests which use `.rows((int) INSTRUCTIONS.lines().count() + 1)` to set the number of rows.
Another set of tests uses `+ 2` instead, the number of such tests is 24.
You can get the list of files using these commands:
grep --recursive --files-with-matches --perl-regexp '.rows((int).*.lines().count().*+.*1.*)' test/jdk
grep --recursive --files-with-matches --perl-regexp '.rows((int).*.lines().count().*+.*2.*)' test/jdk
Two tests added in #20996 use `+ 5`.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21039#issuecomment-2355916309
More information about the client-libs-dev
mailing list