eclipse-jdt / eclipse-jdt/eclipse.jdt.ui
Statically importing a class confuses ECJ
- Dominant language
- Java
- Stars
- 59
- Forks
- 127
- Avg merge
- 22h 47m
- Merged PRs (30d)
- 28
Description
This is probably a weird use case that I would probably never use, but it happened in our code base. The following classes are the smallest reproduction example I could make:
class a/A.java
```java
package a;
import a.A.I;
public abstract class A {
public interface I {
}
}
```
class a/B.java
```java
package a;
import static a.B.R;
public class B extends A {
public record R(long extractedAt) implements I {
}
}
```
In JDT I would see something like:

With the following options as quickfix:

Selecting "**import 'I' (a.A)**" would neither solve nor do anything.
If I compiled the classes with open jdk 17 as:
```
javac -cp . .\a\A.java .\a\B.java
```
They compile just fine without any warnings or errors.
Contributor guide
Assessment
This issue has not been assessed yet.