RFR: JDK-8267936: PreserveAllAnnotations option isn't tested
Brian Goetz
brian.goetz at oracle.com
Thu Jun 3 03:21:23 UTC 2021
It seems pretty clear that this "feature" is a leftover from an early
implementation, doesn't clearly say what it is supposed to do, is more
complicated than it looks, and is buggily implemented. While I
understand the temptation to "fix" it, at this point we'd realistically
be adding a basically entirely new reflection feature that hasn't gone
through any sort of design analysis -- we'd just be guessing about what
the original intent of this vestigial feature is. It seems the
reasonable options are to either leave it alone, deprecate it, or engage
in a much more deliberate redesign. (And given the fact that I can
think of at least 1,000 things that are higher priority, I'd not be
inclined to pursue the third option.)
On 6/2/2021 11:06 PM, Jaroslav Tulach wrote:
> 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.
> FYI: The current test is a "mirror" copy of [AnnotationTypeRuntimeAssumptionTest.java](https://github.com/openjdk/jdk/blob/0f689ea8f29be113cc8a917a86fd9e0f85f921fc/test/jdk/java/lang/annotation/AnnotationType/AnnotationTypeRuntimeAssumptionTest.java) with adjustments to cover the `CLASS`->`RUNTIME` migration.
>
>> What I would do is to add a patch for the parser bug
> That's an interesting discovery! I see a patch and I can include it as your commit in this PR, if there is a test...
>
>> and then extend the test in 3 dimensions:
> ...or just take my PR and expand it. Also the checkbox _"Allow edits and access to secrets by maintainers"_ is on - e.g. this PR is open for modifications.
>
> -------------
>
> PR: https://git.openjdk.java.net/jdk/pull/4280
More information about the core-libs-dev
mailing list