eclipse-jdt / eclipse-jdt/eclipse.jdt.core
Invalid unused import warning
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
For this example
```
package org.example.map.entry;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
public final class Example {
public static void saveProperties(final Map properties) {
new Properties() {
private static final long serialVersionUID = 1L;
@Override
public Set> entrySet() {
Collection keys = properties.keySet();
LinkedHashMap objectMap = new LinkedHashMap<>();
for (String key : keys) {
objectMap.put(key, properties.get(key));
}
return objectMap.entrySet();
}
};
}
}
```
the compiler complains:
```
Description Resource Path Location Type
The import java.util.Map.Entry is never used Example.java /org.example.map.entry/src/org/example/map/entry line 6 Java Problem
```
But if you delete the import the editor shows errors but in an odd way such that there are no errors if the Problems view:

Contributor guide
Assessment
This issue has not been assessed yet.