RFR: 8294961: java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes [v2]
Mandy Chung
mchung at openjdk.org
Wed Feb 8 00:52:49 UTC 2023
On Fri, 3 Feb 2023 15:11:30 GMT, Adam Sotona <asotona at openjdk.org> wrote:
>> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes and this patch converts it to use Classfile API.
>>
>> This pull request suppose to chain on the 8294982: Implementation of Classfile API https://github.com/openjdk/jdk/pull/10982
>>
>> Please review.
>>
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>
> - j.l.r.ProxyGenerator fix - Classfile API moved under jdk.internal.classfile package
> - Merge branch 'JDK-8294982' into JDK-8294961
> - Merge branch 'JDK-8294982' into JDK-8294961
> - 8294961: java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes
src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 221:
> 219: * null or empty
> 220: */
> 221: private static List<ClassDesc> typeNames(List<Class<?>> classes) {
I think this method is not strictly necessary.
`clb.withInterfaceSymbols(typeNames(interfaces))` can simply be replaced with
clb.withInterfaceSymbols(interfaces.stream().map(ProxyGenerator::toClassDesc).toList());
`interfaces` should be non-null. We can add `Objects.requireNonNull(interfaces)` in static `generateProxyClass` method.
-------------
PR: https://git.openjdk.org/jdk/pull/10991
More information about the core-libs-dev
mailing list