RFR: 8333560: -Xlint:restricted does not work with --release [v3]
Jorn Vernee
jvernee at openjdk.org
Wed Jun 5 18:42:08 UTC 2024
> Currently, `-Xlint:restricted` can be used to print out lint warnings when restricted methods are used in source code compiled by javac. However, this option doesn't work as intended when used in combination with `--release`, and instead no warnings are printed at all.
>
> Javac relies on the internal `jdk.internal.javac.Restricted` annotation being present on a method in order to determine if a method is restricted. This annotation is however currently being stripped out when generating shim class files that are used by javac to get release-specific symbol information.
>
> There are already some annotations that are exempt from being stripped away, such as `jdk.internal.javac.PreviewFeature`. The proposed fix is to add `jdk.internal.javac.Restricted` to the list of exempted annotations as well.
>
> Testing: tier 1-3 (ongoing)
Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
use enterSyntheticAnnotation
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/19548/files
- new: https://git.openjdk.org/jdk/pull/19548/files/9dfaf070..cadc668b
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=19548&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=19548&range=01-02
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/19548.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/19548/head:pull/19548
PR: https://git.openjdk.org/jdk/pull/19548
More information about the compiler-dev
mailing list