RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v7]

Adam Sotona asotona at openjdk.org
Mon Jan 8 15:28:53 UTC 2024


On Fri, 5 Jan 2024 21:03:28 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   StackCounter fix
>
> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 148:
> 
>> 146:             generateLookupAccessor(clb);
>> 147:             var cp = clb.constantPool();
>> 148:             q.entries = new PoolEntry[] {
> 
> line 174-197 must match the order of CP entries being added.
> 
> Is there other way to avoid `q.next()` coupling with the order of CP entries in `q.entries`?  Maybe define constants for the indices to `q.entries` such that writing and reading the CP entries from the array using the constant index is easier to read and less error-prone?

I've rewritten the initialization to use indexes inside an array.
Thanks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17121#discussion_r1444825858


More information about the core-libs-dev mailing list