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.


Reply via email to