On Thu, 21 Mar 2024 18:10: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 > > Alex Menkov has updated the pull request incrementally with one additional > commit since the last revision: > > added comment This looks good. test/jdk/java/lang/instrument/RetransformRecordAnnotation.java line 30: > 28: * > 29: * @library /test/lib > 30: * @run shell MakeJAR.sh retransformAgent Does the presence of attributes mean you can't use the simpler RedefineClassHelper that the tests in test/hotspot/jtreg/serviceability/jvmti/RedefineClasses use? ------------- Marked as reviewed by coleenp (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/18161#pullrequestreview-1961478084 PR Review Comment: https://git.openjdk.org/jdk/pull/18161#discussion_r1539953736