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

Guoxiong Li gli at openjdk.org
Sat Mar 9 04:35:56 UTC 2024


On Fri, 8 Mar 2024 02:54:49 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

> RecordComponent class has _attributes_count field.
> The only user of the field is JvmtiClassFileReconstituter. Incorrect value of the field causes producing incorrect data for Record attribute.
> Parsing Record attribute ClassFileParser skips unknown attributes and may skip RuntimeInvisibleAnnotations/RuntimeInvisibleTypeAnnotations.
> The fix updates ClassFileParser to calculate correct attributes_count.
> 
> Testing: 
> - tier1,tier2,hs-tier5-svc;
>  - redefineClasses/retransformClasses tests:
>    - test/jdk/java/lang/instrument
>    - test/hotspot/jtreg/serviceability/jvmti/RedefineClasses
>    - test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses
>    - test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses

test/jdk/java/lang/instrument/RetransformRecordAnnotation.java line 27:

> 25:  * @test
> 26:  * @bug 8315575
> 27:  * @summary test that records with invisible annotation can be retfansformed

Typo `retfansformed`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18161#discussion_r1518468461


More information about the serviceability-dev mailing list