Are classes generated by LambdaMetafactory special?
mandy.chung at oracle.com
Mon Aug 5 21:11:02 UTC 2019
This is intentional. The lambda proxy classes are defined as VM
anonymous classes through a JDK internal API
Unsafe::defineAnonymousClass. These generated classes are JDK
implementation details that are hidden for any class lookup and not
modifiable by JVM TI agent.
JDK-8171335 is the RFE to define a supported API to replace Unsafe VM
anonymous class. We have a prototype in the "nestmates" branch in
valhalla repo .
On 8/5/19 2:02 PM, Raffaello Giulietti wrote:
> experiment suggests that classes generated by
> java.lang.invoke.LambdaMetafactory are somewhat special:
> (1) getName() on the class returns a string of the form
> where Xxx is a fully qualified class name (with periods '.' as package
> separators), nn is a decimal integer and hhh is a hex integer. What's
> the role of the slash '/' in the name?
> (2) An invocation of Class.forName() with that name fails.
> (3) Invoking java.lang.instrument.Instrumentation.isModifiableClass()
> with that class as an argument returns false.
> Is this intentional or is it a bug?
More information about the core-libs-dev