RFR: JDK-8315575: Retransform of record class with record component annotation fails with CFE [v3]

Alex Menkov amenkov at openjdk.org
Wed Mar 13 23:28:38 UTC 2024


On Wed, 13 Mar 2024 04:36:26 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

> It is interesting that if an invisible attribute of a `RecordComponent` was not ignored because the `PreserveAllAnnotations` is enabled then it the `JvmtiClassFileReconstituter` treats it as a visible attribute. Not sure, if we should treat it as a bug.

Yes, if PreserveAllAnnotations is enabled, in the reconstituted class file the annotations become visible.
I suppose this is considered normal because effectively PreserveAllAnnotations makes annotations "visible" (i.e.VM sees them).

But we have an issue here.
if PreserveAllAnnotations is enabled and class has only RuntimeInvisibleAnnotations (no RuntimeVisibleAnnotations), the class constant pool does not contain "RuntimeVisibleAnnotations" and JvmtiClassFileReconstituter fails. I'll file a separate issue for this.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18161#issuecomment-1996075217


More information about the serviceability-dev mailing list