[lworld] RFR: JDK-8271556: [lworld] java.lang.BootstrapMethodError in .equals() for primitive record
Mandy Chung
mchung at openjdk.java.net
Mon Aug 16 16:34:07 UTC 2021
On Thu, 12 Aug 2021 21:35:13 GMT, Jesper Steen Møller <jespersm at openjdk.org> wrote:
>> We want the default choice is to use the primary L-type mirror and only
>> when there is a contextual need to make a distinction, the Q-type mirror will be an option.
>>
>> The proposal is to always pass the primary mirror to the `recordClass` argument
>> and adjust the bootstrap code to drive method handle creation off of the primitive
>> value type of the record class instead of `recordClass`, using `recordClass` only
>> for getting the class name for `toString`.
>
> src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 340:
>
>> 338: Class<?> receiverType = recordClass.isPrimitiveClass() ? recordClass.asValueType() : recordClass;
>> 339:
>> 340: if (type instanceof MethodType) {
>
> Nitpicking: Perhaps
>
> if (type instanceof MethodType mType) {
> methodType = mType;
> if (mType.parameterType(0) != receiverType) {
>
> ?
sure. I may fix it in jdk repo directly.
-------------
PR: https://git.openjdk.java.net/valhalla/pull/528
More information about the valhalla-dev
mailing list