RFR: 8294961: java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes [v2]

Brian Goetz brian.goetz at oracle.com
Thu Mar 9 19:45:00 UTC 2023


> 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