Bug 575870 - UI freeze in Java Editor when deleting/inserting text while mouse hovering it
Summary: UI freeze in Java Editor when deleting/inserting text while mouse hovering it
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.20   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.22 M1   Edit
Assignee: Kenneth Styrberg CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate, performance, ui, usability
Depends on:
Blocks:
 
Reported: 2021-09-08 05:40 EDT by Robert Müller CLA
Modified: 2021-09-26 12:00 EDT (History)
4 users (show)

See Also:


Attachments
Error log entries for one particular UI freeze (47.50 KB, text/plain)
2021-09-08 05:40 EDT, Robert Müller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Müller CLA 2021-09-08 05:40:16 EDT
Created attachment 287106 [details]
Error log entries for one particular UI freeze

I constantly get UI freezes in the Java Editor when deleting/inserting any amount text while moving the mouse over the changed text.

The following minimal example triggers the UI freeze:

public class Test {
	public static void main(String[] args) {
		Object obj = new Object();
		obj.toString();
	}
}

To produce a UI freeze, position the text caret somewhere inside "toString". Then while moving the mouse cursor back and forth over "toString" remove or add one letter with the keyboard and then undo the change. Undoing the change causes a UI freeze, probably because the mouse hover event handler waits on the UI thread. The log is attached.

For context, I have almost 500 plugin projects opened in my workspace. I use the Package Explorer and not the Project Explorer. I have the Project Explorer closed because I read in another issue that it could cause lag, but it does not appear to be the cause of this particular issue.
Comment 1 Kenneth Styrberg CLA 2021-09-08 07:01:11 EDT
At line 299 in JavaElementHyperlinkDetector: 
CompilationUnit astRoot= SharedASTProviderCore.getAST(input, SharedASTProviderCore.WAIT_YES, null);

Maybe should be:
CompilationUnit astRoot= SharedASTProviderCore.getAST(input, SharedASTProviderCore.WAIT_NO, null);
                                                                                      ^
Comment 2 Eclipse Genie CLA 2021-09-08 17:10:06 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/185179
Comment 3 Kenneth Styrberg CLA 2021-09-09 10:15:01 EDT
A problem is that when I set SharedASTProviderCore.WAIT_NO, I can't get the tests to pass. That's why I set it to WAIT_YES when I added the feature not noticing any freeze in the IDE.

When running the IDE it works fine with WAIT_NO.

Does anyone have some better insight why this is happening?
Comment 4 Lars Vogel CLA 2021-09-21 06:36:50 EDT
I also see this freeze frequently at a client machine.
Comment 6 Kenneth Styrberg CLA 2021-09-26 11:58:15 EDT
Tested ok, in build eclipse-SDK-I20210926-0600-win32-x86_64