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

Issues regarding imports with referring to inner enum of parent type in JavaDoc

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

Description

Test project showing the issue: [test.zip](https://github.com/eclipse-jdt/eclipse.jdt.core/files/9741922/test.zip)

This project is configured to check for malformed JavaDoc comments.

Class `test.Test1` defines a enum `E` with constants `A` and `B`.

Class `test.Test2` extends `test.Test1` and refers to `E#A` in the JavaDoc. This gives a warning, for which I have the following questions:
1. Is the warning correct? `Test2` extends `Test1`, so why isn't `E` just available in this scope?
2. If indeed `E` should not be in scope there, then why is there no quick fix to add the import for `test.Test1.E`?

Class `test.Test3` is similar to `test.Test2`, but this does have the `test.Test1.E` import. There are no warnings, as expected. But, if I let Eclipse organize the imports, the import is removed. I then get the warning again. I have the following question:

3. Should organize imports not keep this import, as removing it leads to a warning for the missing import? (assuming that the import is indeed needed, per question 1)

It seems that the import is needed (`Test2` has a warning)) but also not needed (in `Test3` it is removed when organizing imports). This seems inconsistent.

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.