eclipse-jdt / eclipse-jdt/eclipse.jdt.core
Possibly bogus warning for public exported types when the export target contains those types
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
Suppose a `module dep` that exports `package dep` with class `dep.D`. And suppose another module:
```java
module App {
requires dep;
exports app to dep;
}
```
then
```java
package app;
public class A {
public dep.D d;
}
```
emits a warning:
```
The type D from module dep may not be accessible to clients due to missing 'requires transitive'
```
While it's true that it *may* not be accessible, since the module exposes the package (and class) to the module that defines that class, we can know that it will be accessible.
Can the compiler be smarter and check if the targets of an export have access to the exposed types?
Contributor guide
Assessment
This issue has not been assessed yet.