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

Jaikiran Pai jpai at openjdk.org
Tue Apr 8 01:03:10 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.

This looks OK to me. I think it would be good to have someone more familiar with this area review this too.

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

Marked as reviewed by jpai (Reviewer).

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


More information about the kulla-dev mailing list