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

Alex Menkov amenkov at openjdk.org
Fri Mar 8 02:59:22 UTC 2024


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

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

Commit messages:
 - fix

Changes: https://git.openjdk.org/jdk/pull/18161/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18161&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8315575
  Stats: 133 lines in 2 files changed: 131 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/18161.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18161/head:pull/18161

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


More information about the serviceability-dev mailing list