Integrated: 7903963: Fix "Run Configuration" Window Freeze Issue

Oleksii Sylichenko duke at openjdk.org
Mon Mar 10 14:40:14 UTC 2025


On Wed, 5 Mar 2025 16:15:46 GMT, Oleksii Sylichenko <duke at openjdk.org> wrote:

> # When the Problem Occurs
> 
> The JTReg "Run Configuration" window freezes when the user selects a JRE that is not present in the project's SDK list.
> 
> # Why the Problem Occurs
> 
> There is a method `applyEditorTo` in the `JTRegConfigurable.java` class, which is called repeatedly while the "Run Configuration" window is open. Within this method, the method `jrePathEditor.getJrePathOrName()` is invoked. As a result, when this method is called for a JRE path not listed in IDEA, it attempts to determine the Java version. If the user has selected a raw JDK image, a Java process is launched, and the version is obtained from the process output (see [org.jetbrains.jps.model.java.impl.JdkVersionDetectorImpl#detectJdkVersionInfo](https://github.com/JetBrains/intellij-community/blob/baba77ecf93f44a2ccb34e5b206e03c60817d511/jps/model-impl/src/org/jetbrains/jps/model/java/impl/JdkVersionDetectorImpl.java#L40)). 
> 
> This call is too resource-intensive to be executed on the UI thread, causing the window to freeze.
> 
> # Steps to reproduce
> 
> 1. Open a JDK project.  
> 2. Open the "Project Structure" window.  
> 3. Navigate to "Platform Settings → SDKs".
> 4. Remove the JDK that is used as the JRE for tests, or create a copy of this JDK on your file system.  
> 5. Create a new "JTReg Run Configuration".  
> 6. In the "JRE" field, select a JDK path that is not present in the Project SDK list (either the removed JDK or the copied one).  
> 
> ## Actual result
> - The window starts freezing, even after saving and reopening it.
> 
> # Implemented Changes
> 
> ## JTRegConfigurable.java
> - Fix Javadoc for the class.
> - Remove unused class field: `jtregDir`.
> - Add Javadoc to the methods: `createUIComponents`, `applyEditorTo`, `resetEditorFrom`
> - Fix window freeze caused by `jrePathEditor` in the method `applyEditorTo`.
> - Add method `applyEditorJrePathTo` to optimize data retrieval from `jrePathEditor`.
> 
> Since I implemented changes in this file, I also took the opportunity to clean up the code a bit.

This pull request has now been integrated.

Changeset: 1d63247e
Author:    Oleksii Sylichenko <a.silichenko at gmail.com>
Committer: Christian Stein <cstein at openjdk.org>
URL:       https://git.openjdk.org/jtreg/commit/1d63247e6c76c8a1010035a310f11cf11ec8aae4
Stats:     78 lines in 1 file changed: 71 ins; 3 del; 4 mod

7903963: Fix "Run Configuration" Window Freeze Issue

Reviewed-by: jvernee, cstein

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

PR: https://git.openjdk.org/jtreg/pull/250


More information about the jtreg-dev mailing list