RFR: 8353332: Test jdk/jshell/ToolProviderTest.java failed in relation to enable-preview

Adam Sotona asotona at openjdk.org
Tue Apr 8 09:28:19 UTC 2025


On Mon, 7 Apr 2025 15:44:35 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> JShell keeps persisted preferences in `java.util.prefs.Preferences`. But, during tests, an empty persistence is typically used, to avoid values persisted on the test machine to affect the test.
> 
> But, in case of `jdk/jshell/ToolProviderTest.java`, this is not done, as JShell is started using the `Tool` interface.
> 
> This patch strives to fix that, by adding indirection in building JShell in `JShellToolProvider`, and using that in the test to inject empty persistence.
> 
> Thanks to @jaikiran for figuring out the probable cause.

Looks good to me.

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

Marked as reviewed by asotona (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24492#pullrequestreview-2749291240


More information about the kulla-dev mailing list