Bug 575870

Summary: UI freeze in Java Editor when deleting/inserting text while mouse hovering it
Product: [Eclipse Project] JDT Reporter: Robert Müller <robytemueller>
Component: UIAssignee: Kenneth Styrberg <kenneth>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: kenneth.styrberg, kenneth, Lars.Vogel, loskutov
Version: 4.20Keywords: investigate, performance, ui, usability
Target Milestone: 4.22 M1   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/185179
https://bugs.eclipse.org/bugs/show_bug.cgi?id=575864
https://bugs.eclipse.org/bugs/show_bug.cgi?id=575990
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=ad42f86740eb7a362c118be703475daebdb89a71
Whiteboard:
Attachments:
Description Flags
Error log entries for one particular UI freeze none

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