Bug 539643 - Missing import quick fix
Summary: Missing import quick fix
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.9   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-29 05:41 EDT by Ed Willink CLA
Modified: 2022-12-05 15:31 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2018-09-29 05:41:22 EDT
2018-09: The quality of import quick fixes seems to have deteriorated a couple of years ago; there are many contexts where the import must be manually typed. I just found one that is close to a repro; it persists after an Eclipse restart.

Given the following source:

package org.eclipse.qvtd.compiler.internal.utilities;

//import org.eclipse.ocl.pivot.utilities.ClassUtil;
import org.eclipse.qvtd.pivot.qvtschedule.ConnectionRole;

public class ToGraphPartitionVisitor2
{
	public void visit() {
		ConnectionRole targetConnectionRole = ClassUtil.nonNullState(null);
	}
}

ClassUtil is unresolved, but no no import quick fix is offered when hovering over ClassUtil. Rather a bad quick fix to add the org.eclipse.ocl.pivot bundle is offered even though that bundle is already required.

Uncommenting the ClassUtil import solves the problem.

If instead the "ConnectionRole targetConnectionRole = " text is deleted, the quick fix correctly offers org.eclipse.ocl.pivot.utilities.ClassUtil.

(
ConnectionRole is an enum.

nonNullState is templated.

public static @NonNull <T> T nonNullState(@Nullable T aT) {
)
Comment 1 Eclipse Genie CLA 2020-09-30 13:55:26 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.
Comment 2 Ed Willink CLA 2020-10-01 02:55:38 EDT
I still see this, but find that after a minute or so a retry and the quick fix is there.

It would appear that the background job that prepares the 'index' can be really really slow.

If a quick fix is not yet available, the quick fix dialog should pop up a please wait/retry later dialog.
Comment 3 Eclipse Genie CLA 2022-12-05 15:31:40 EST
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.