On Fri, 8 Mar 2024 02:54:49 GMT, Alex Menkov <amen...@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.
> Also annotations can be changed (added/removed) by class redefinition.
> The fix removes attributes_count from RecordComponent; 
> JvmtiClassFileReconstituter calculates correct attributes_count generating 
> class bytes.
> 
> 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

This pull request has now been integrated.

Changeset: 8fc9097b
Author:    Alex Menkov <amen...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/8fc9097b3720314ef7efaf1f3ac31898c8d6ca19
Stats:     208 lines in 5 files changed: 190 ins; 10 del; 8 mod

8315575: Retransform of record class with record component annotation fails 
with CFE

Reviewed-by: sspitsyn, coleenp

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

PR: https://git.openjdk.org/jdk/pull/18161

Reply via email to