RFR: JDK-8267936: PreserveAllAnnotations option isn't tested
Jaroslav Tulach
github.com+26887752+jaroslavtulach at openjdk.java.net
Wed Jun 2 05:47:32 UTC 2021
On Tue, 1 Jun 2021 09:30:40 GMT, Jaroslav Tulach <github.com+26887752+JaroslavTulach at openjdk.org> wrote:
> There doesn't seem to be much support for the complete changes in #4245. To get at least something useful from that endeavor I have extracted the test for existing behavior of `-XX:+PreserveAllAnnotations` and I am offering it in this pull request without any changes to the JVM behavior.
Right Peter, the `AnnotationTypeChangedToRuntimeTest` mimics closely the use-case:
> JVM as a late-binding runtime ... There are exceptions to the rule such
as compile-time constants, ... and also annotation uses where the
information from one source file (annotation retention) is baked into
compilation artifacts of other source files (`RuntimeVisibleAnnotations`
vs. `RuntimeInvisibleAnnotations`). `PreserveAllAnnotations` option helps to
overcome the situation
Great formulation of the problem. The late binding allows people to ignore time of compilation when thinking about the running system. Ignoring time makes the mental model of the overall system easier. But when certain information is _baked_ elsewhere, ignoring time is may no longer be possible as the sequence of actions becomes important - an up to date system may see relics of the past (old values of compile-time constants and annotation not being visible even their most recent retention is `RUNTIME`).
This PR isn't going to modify behavior of the `-XX:+PreserveAllAnnotations` option in any way. It only provides a test. Having a test is better than having none. Can we consider this PR reviewed? Can somebody with enough merit mark this _change as properly reviewed_? Can somebody restart the _Windows aarch64 - Build_ - the error seems unrelated?
-------------
PR: https://git.openjdk.java.net/jdk/pull/4280
More information about the core-libs-dev
mailing list