RFR: 8294961: java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes [v2]
-
liangchenblue at gmail.com
Thu Mar 9 21:38:09 UTC 2023
We can already accomplish that with type.describeConstable().orElseThrow();
and we can replace all map(ProxyGenerator::toClassDesc) calls with
map(Class::describeConstable).map(Optional::orElseThrow) instead.
On Thu, Mar 9, 2023 at 1:45 PM Brian Goetz <brian.goetz at oracle.com> wrote:
>
>
> > src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 390:
> >
> >> 388: uniqueList.add(ex);
> >> 389: }
> >> 390: return uniqueList.stream().map(ex -> ClassDesc.ofDescriptor(ex.descriptorString())).toList();
> > It would be useful to add a helper method to convert Class to ClassDesc:
> >
> > private static ClassDesc toClassDesc(Class<?> type) {
> > return ClassDesc.ofDescriptor(type.descriptorString());
> > }
>
> I would love it if we could have this as a factory on ClassDesc itself.
> We'd have to filter VMAC/hidden classes (and any other classes that
> can't be resolved symbolically), probably by returning
> Optional<ClassDesc> instead of ClassDesc.
>
>
More information about the core-libs-dev
mailing list