[External] : Re: JEP 401 -- reflection and class literals
Remi Forax
forax at univ-mlv.fr
Sun Jun 27 21:27:42 UTC 2021
----- Original Message -----
> From: "Brian Goetz" <brian.goetz at oracle.com>
> To: "Peter Levart" <peter.levart at gmail.com>
> Cc: "valhalla-spec-experts" <valhalla-spec-experts at openjdk.java.net>
> Sent: Dimanche 27 Juin 2021 22:01:21
> Subject: Re: [External] : Re: JEP 401 -- reflection and class literals
>>
>>
>> Seems like we are forced to re-use Class objects to hold this
>> additional info. Remi says that there should only be "primary" (ref
>> type) primitive class literals (Foo.class) and no (Foo.ref.class or
>> Foo.val.class) and that val type mirrors should be obtained by calling
>> a method (such as Foo.class.asPrimitiveValType()), but that makes
>> methods/constructors using val-typed parameters second class citizens
>> when using reflection.
>
> And even worse with MethodHandle.
java.lang.reflect and java.lang.invoke are actually second class citizen APIs, they are built that way.
At least until we have to deal with API points throwing Throwable where the only sensible way to deal with it is to rethrow it.
Rémi
More information about the valhalla-spec-observers
mailing list