Bug 570484 - “Organize Imports” command (CTRL + SHIFT + O) completely freeze Eclipse
Summary: “Organize Imports” command (CTRL + SHIFT + O) completely freeze Eclipse
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.18   Edit
Hardware: PC Windows 10
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2021-01-19 09:37 EST by Francesco Zambon CLA
Modified: 2023-10-26 16:21 EDT (History)
4 users (show)

See Also:


Attachments
thread dumps generated by jstack at the freeze time (34.86 KB, text/plain)
2021-01-20 05:35 EST, Francesco Zambon CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.