RFR: 8277106: Cannot compile certain sources with --release [v2]
Jan Lahoda
jlahoda at openjdk.java.net
Tue Dec 7 14:01:00 UTC 2021
> While working on JDK-8277105[1], it turned out the historical data in `ct.sym` are not quite right in two directions:
> a) some API classes extend classes from non-exported packages (often from the `java.base` module). Examples include `jdk.jfr.Event` which extends `jdk.internal.event.Event`. As the current `ct.sym` data do not keep classes from non-exported packages, compilation against these classes fails.
> b) permitted subtypes may include classes from non-exported packages, and these are needed to properly determine validity of casts and pattern matching switches. But these classes are not kept in the `ct.sym`, and hence the behavior of the casts may be incorrect. (Although I am no aware of any cases where an actual problem would arise with the current APIs.)
>
> The proposed solution is to keep a certain amount of classes from non-exported packages in the historical record, specifically classes that are either extended by a class in an exported package, or named as a permitted subclass in an exported package.
>
> The first occurrence of a) I was able to find was in JDK 11, so this patch also fixes the historical record till JDK 11.
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8277105
Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
- Removing aspects related to sealed classes.
- Merge branch 'master' into JDK-8277106
- 8277106: Cannot compile certain sources with --release
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/6417/files
- new: https://git.openjdk.java.net/jdk/pull/6417/files/5388078d..1acbe84e
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6417&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6417&range=00-01
Stats: 41846 lines in 1133 files changed: 26187 ins; 9349 del; 6310 mod
Patch: https://git.openjdk.java.net/jdk/pull/6417.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/6417/head:pull/6417
PR: https://git.openjdk.java.net/jdk/pull/6417
More information about the compiler-dev
mailing list