eclipse-jdt / eclipse-jdt/eclipse.jdt.core
[content assist] Map.get() should use generic type information to limit the suggestions
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
This originated from https://bugs.eclipse.org/bugs/show_bug.cgi?id=572611, but was slightly modified here:
The content assist for Map.get() should use type information for the parameter. I'm aware that Java does not have reified generics, but in the IDE this information should be available.
Consider:
```
public static void test() {
Double twoDotOne = 2.2;
Exception ex = new Exception();
String a = "a";
Integer one = 1;
Map intToString = new HashMap<>();
Map stringToInt = new HashMap<>();
intToString.put(one, a);
stringToInt.put(a, one);
String result = intToString.get( position Eclipse should show "one" as the first suggestion.
No idea if this is a feature request or a bug.
Contributor guide
Assessment
This issue has not been assessed yet.