Integrated: 8357048: RunTest variables should always be assigned

Magnus Ihse Bursie ihse at openjdk.org
Wed May 21 09:25:58 UTC 2025


On Tue, 20 May 2025 13:28:22 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

> In `SetJtregValue` and `SetMicroValue`, if a default or user-supplied value was given, the corresponding "local" variable was assigned using :=, which will force future eager evaluation of the variable, most notably `+=`. However, if no default nor user-assigned value was given, the variable was not defined at all, which would lead the first `+=` to create a lazy evaluated definition (a macro).
> 
> Since this was the common behavior for `JTREG_BASIC_OPTIONS`, we did not notice that `JTREG_TIMEOUT_FACTOR` did not have a value when it was used, but that it was assigned later. This made the evaluation broke when we set that variable on the command line and thus forcing eager definition.
> 
> The fix is to make sure JTREG_TIMEOUT_FACTOR is defined before use. I also changed so SetJtregValue always assigns with :=, so a similar problem could not creep in again. The same problem also existed in SetMicroValue, so I fixed it there too. (There were no bugs caused by this, though.)

This pull request has now been integrated.

Changeset: 7c82e09b
Author:    Magnus Ihse Bursie <ihse at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/7c82e09b509a67cafd67f6d2aa33756bf8755253
Stats:     6 lines in 1 file changed: 5 ins; 0 del; 1 mod

8357048: RunTest variables should always be assigned

Reviewed-by: erikj

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

PR: https://git.openjdk.org/jdk/pull/25327


More information about the build-dev mailing list