eclipse-jdt / eclipse-jdt/eclipse.jdt.core

[content assist] Anonymous inner class has wrong type parameters

Open
#3,084 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

Original issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=572825

If I have
```
public class MyMap implements Map {

@Override
public Set keySet() {
return new Set<== Content assist trigger
}
}
```
and want to create an anonymous set in keySet() then content assist creates
```
return new Set() {
};
```
The `MyMap.K` is incorrect. Content assist should generate
```
return new Set() {
};
```
Note that the quick fix suggests changing `MyMap.K` to `K`.

This bug still shows up with Eclipse 4.33 (2024-09).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.