Bug 570484

Summary: “Organize Imports” command (CTRL + SHIFT + O) completely freeze Eclipse
Product: [Eclipse Project] JDT Reporter: Francesco Zambon <francesco.zambon.padova>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3 CC: francesco.zambon.padova, jkubitz-eclipse, kalyan_prasad, loskutov
Version: 4.18Keywords: needinfo
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=509999
Whiteboard: stalebug
Attachments:
Description Flags
thread dumps generated by jstack at the freeze time none

Description Francesco Zambon CLA 2021-01-19 09:37:52 EST
“Organize Imports” command (CTRL + SHIFT + O) completely freeze Eclipse during the resolution of imports with deep hierarchy (at least 10 super classes).
I have to kill Eclipe's process.

Same behavior can be replicated using the following code:

...
		Runnable job = new Runnable() {

			@Override
			public void run() {
			
				// import org.eclipse.jdt.ui.actions.OrganizeImportsAction;
				OrganizeImportsAction org = new OrganizeImportsAction(targetSite);
				
				try {
					org.run();
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		};
...


Environment
Eclipse IDE for Enterprise Java Developers (includes Incubating components)

Version: 2020-12 (4.18.0)
Build id: 20201210-1552

plugins:
org.eclipse.jdt.ui_3.22.0.v20201121-1451.jar
Comment 1 Andrey Loskutov CLA 2021-01-19 14:48:17 EST
Please attach thread dumps generated by jstack at the freeze time, and ideally self contained project with the code in question that reproduces the hang.
Comment 2 Francesco Zambon CLA 2021-01-20 05:35:50 EST
Created attachment 285325 [details]
thread dumps generated by jstack at the freeze time

Hi Andrey, 

thanks for your reply.

I've attached thread dumps generated by jstack at the freeze time.

command:
C:\eclipse-jee-2020-12-R-win32-x86_64\eclipse\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_15.0.1.v20201027-0507\jre\bin\jstack 17364 > jstack.out.txt
Comment 3 Jörg Kubitz CLA 2021-11-04 10:09:36 EDT
(In reply to Francesco Zambon from comment #2)
> I've attached thread dumps generated by jstack at the freeze time.

Francesco can you please add an example how to reproduce?
The code in comment 1 does not compile (targetSite cannot be resolved to a variable).
Also i do not understand if the code should be executed or if that code should be organized.
The stacktrace provided does not look like a deadlock but like a very slow progress as in bug 509999
Comment 4 Eclipse Genie CLA 2023-10-26 16:21:07 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.