Skip to content

"Import Type" quick-fix missing for types with diamond operator #5039

@ptziegler

Description

@ptziegler

Consider the following snippet:

package test2;

import java.util.ArrayList;
import java.util.List;

public class Main {
	public static void main(String[] args) {
		List<Border> borders = new ArrayList<>();
	}
}

This class produces a compilation error, because the javax.swing.border.Border import is missing. However, this option is missing in the context menu and the quickfix (tested with I20260428-1800). If I change the assignment to List<Border> borders = new ArrayList<Border>();, the type is suggested again.

Image

For comparision, here is how it used to look like (tested with 20240905-0614)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionSomething was broken by a previous change

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions