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

Jan Lahoda jlahoda at openjdk.org
Mon Apr 7 15:50:11 UTC 2025


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.

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

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

Changes: https://git.openjdk.org/jdk/pull/24492/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24492&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8353332
  Stats: 51 lines in 2 files changed: 37 ins; 1 del; 13 mod
  Patch: https://git.openjdk.org/jdk/pull/24492.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24492/head:pull/24492

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


More information about the kulla-dev mailing list